Skip to main content
Rollback to Revision 1
Source Link
#include <stdio.h> #include <stdlib.h>   #define FUNCTION_NAME(__FUNCTION__) printf("__FUNCTION__=%s \r\n", #__FUNCTION__); 

#define FUNCTION_NAME(FUNCTION) printf("FUNCTION=%s \r\n", #FUNCTION);

int a() { printf("A function call"); } int b() { printf("B function call"); } int main(){  FUNCTION_NAME(a);  FUNCTION_NAME(b);  return 0; } 

Put double underscores in front and back of FUNCTION.}

#include <stdio.h> #include <stdlib.h>   #define FUNCTION_NAME(__FUNCTION__) printf("__FUNCTION__=%s \r\n", #__FUNCTION__); int a() { printf("A function call"); } int b() { printf("B function call"); } int main(){  FUNCTION_NAME(a);  FUNCTION_NAME(b);  return 0; } 

Put double underscores in front and back of FUNCTION.

#include <stdio.h> #include <stdlib.h> 

#define FUNCTION_NAME(FUNCTION) printf("FUNCTION=%s \r\n", #FUNCTION);

int a() { printf("A function call"); } int b() { printf("B function call"); } int main(){ FUNCTION_NAME(a); FUNCTION_NAME(b); return 0; 

}

Formatting fix
Source Link
#include <stdio.h> #include <stdlib.h> 

#define FUNCTION_NAME(FUNCTION) printf("FUNCTION=%s \r\n", #FUNCTION);

 #define FUNCTION_NAME(__FUNCTION__) printf("__FUNCTION__=%s \r\n", #__FUNCTION__); int a() { printf("A function call"); } int b() { printf("B function call"); } int main(){  FUNCTION_NAME(a);  FUNCTION_NAME(b);  return 0; } 

}

put Put double underscoreunderscores in front and back of FUNCTIONFUNCTION.

#include <stdio.h> #include <stdlib.h> 

#define FUNCTION_NAME(FUNCTION) printf("FUNCTION=%s \r\n", #FUNCTION);

int a() { printf("A function call"); } int b() { printf("B function call"); } int main(){ FUNCTION_NAME(a); FUNCTION_NAME(b); return 0; 

}

put double underscore in front and back of FUNCTION

#include <stdio.h> #include <stdlib.h>  #define FUNCTION_NAME(__FUNCTION__) printf("__FUNCTION__=%s \r\n", #__FUNCTION__); int a() { printf("A function call"); } int b() { printf("B function call"); } int main(){  FUNCTION_NAME(a);  FUNCTION_NAME(b);  return 0; } 

Put double underscores in front and back of FUNCTION.

added 53 characters in body
Source Link
#include <stdio.h> #include <stdlib.h> 

#define FUNCTION_NAME(FUNCTION) printf("FUNCTION=%s \r\n", #FUNCTION);

int a() { printf("A function call"); } int b() { printf("B function call"); } int main(){ FUNCTION_NAME(a); FUNCTION_NAME(b); return 0; 

}

put double underscore in front and back of FUNCTION

#include <stdio.h> #include <stdlib.h> 

#define FUNCTION_NAME(FUNCTION) printf("FUNCTION=%s \r\n", #FUNCTION);

int a() { printf("A function call"); } int b() { printf("B function call"); } int main(){ FUNCTION_NAME(a); FUNCTION_NAME(b); return 0; 

}

#include <stdio.h> #include <stdlib.h> 

#define FUNCTION_NAME(FUNCTION) printf("FUNCTION=%s \r\n", #FUNCTION);

int a() { printf("A function call"); } int b() { printf("B function call"); } int main(){ FUNCTION_NAME(a); FUNCTION_NAME(b); return 0; 

}

put double underscore in front and back of FUNCTION

Source Link
Loading