C++ 打印文件名, 行号,编译日期和时间例子

时间:2014-11-02 00:38:57   收藏:0   阅读:325
/*********************************************************************************  
 Copyright (C), 1988-1999, drvivermonkey. Co., Ltd.  
 File name:   
 Author: Driver Monkey  
 Version:   
 Mail:bookworepeng@hotmail.com  
 Date: 2014.04.02  
 Description:   
 *********************************************************************************/  


#include <iostream>
#include <sstream>
#include <fstream>


using namespace std;


/* run this program using the console pauser or add your own getch, system("pause") or input loop */


int main(int argc, char** argv) {
 cout<<__LINE__<<endl;//打印行号 
 cout<<__FILE__<<endl;//打印文件名 
 cout<<__DATE__<<endl;//打印日期 
 cout<<__TIME__<<endl;//打印时间 
}

原文:http://blog.csdn.net/drivermonkey/article/details/40689641

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!