You need to use string encoding with #:
#define TRACE(string) printf("Trying to execute: %s\n",
string
Full example:
#include <stdio.h>
#define TRACE(string) printf("Trying to execute: %s\n",#string); \
string
void foo() {
printf("1\n");
}
void bar() {
printf("2\n");
}
int main() {
foo();
TRACE(bar(););
}
output:
1
Trying to execute: bar();
2
source
share