Dear there, is there a way to print the function's name inside itself? I know the trick to print a variable name in macro using #:
#define P(x) cout << #x << ": " << x << endl;
I am wondering whether there is a similar way to do it for functions.
Dear there, is there a way to print the function's name inside itself? I know the trick to print a variable name in macro using #:
#define P(x) cout << #x << ": " << x << endl;
I am wondering whether there is a similar way to do it for functions.
GCC has the __FUNCTION__ and __PRETTY_FUNCTION__ macros. Other compilers probably have same or similar macros.
I might be wrong.
Quoted more than 1000 times (I hope).Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.