In the C language, __FUNCTION__ can be used to get the current function\'s name. But if I define a function named a() and it is called
__FUNCTION__
If you are using Linux system, you can use the backtrace() function.
backtrace()
See the man page for more details and a code example.