C ++ prints the file name, row number, compilation Date and Time example, and file name line number
/*************************************** **************************************** ** Copyright (C ), 1988-1999, drvivermonkey. co ., ltd. file name: Author: Driver Monkey Version: Mail: bookworepeng@hotmail.com Date: 4.04.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; // print the row number cout <__file __< <endl; // print the FILE name cout <__date __< endl; // print the date cout <__time __< <endl; // print the TIME}
How does the C language print the file name of the current source file and the current row number of the source file?
Print file, function, row number
Printf ("file = % s, func = % s, line = % d \ n" ,__ FILE __,__ FUNCTION __,__ LINE __);
In Linux c program, how does one print the file name and row number of the current file?
Printf ("% s, % u" ,__ FILE __,__ LINE __);