EmadGirgis
asked on
In C++, I need a macro that builds a string that includes the file and the line number..
C++, Linux
as part of my effort to understand an application I have, I need to build a macro that automatically builds a string with the file number and the line number.
I can print that string that will show me the execution path.
I am going to add this Macro in places and print the output!
as part of my effort to understand an application I have, I need to build a macro that automatically builds a string with the file number and the line number.
I can print that string that will show me the execution path.
I am going to add this Macro in places and print the output!
ASKER
Thank you very much...
I need to advance this so it would generate me a string to pass to other function!!
So I mean
string S
S would be equal to
("%s %s %d\n",__FILE__,__FUNCTION_ _,__LINE__ )
I need to advance this so it would generate me a string to pass to other function!!
So I mean
string S
S would be equal to
("%s %s %d\n",__FILE__,__FUNCTION_
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
#define LOG_HERE printf("%s %s %d\n",__FILE__,__FUNCTION_