W
Wei Li
and how to ?
thanks for any help
thanks for any help
Wei said:and how to ?
thanks for any help
Sean Fraley said:If you are asking if it is possible to get the name of the calling function
from inside the function that was called, the answer is no.
Wei said:and how to ?
thanks for any help
Wei Li said:and how to ?
thanks for any help
tigervamp said:"Wei Li" <[email protected]> wrote in message
How about something like this:
#include <stdio.h>
#define PrintParentFunc() printf("Parent Function: %s\n",__func__)
void SubFunc (void);
int main (void) {
PrintParentFunc();
SubFunc();
return 0;
}
void SubFunc (void) {
PrintParentFunc();
}
Assuming of course you are using a compiler which supports the
__func__ predefined identifier (Officially introduced in C99).
Rob Gamble
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.