#include <iostream>
using namespace std;
void testFunc(void){
printf("File = %s\nLine = %d\nFunc=%s\nDate=%s\nTime=%s\n",
__FILE__, __LINE__, __FUNCTION__, __DATE__, __TIME__);
}
int main(int argc, char* argv[])
{
testFunc();
getchar();
return 0;
}
输出结果:
File = c:\test\hello.cpp Line = 8 Func=testFunc Date=Sep 7 2016 Time=10:15:42