I'm learning C programming (
) and i've found that a macro that apprently is very good doesn't work - hmmm me thinks this ain't THAT good :P
The macro is :
Code:
#define TRACE printf("%s @ %u\n",_ _FILE_ _,_ _LINE_ _)
i've got it set in a test app so you can see how I've used it:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define TRACE printf("%s @ %u\n",_ _FILE_ _,_ _LINE_ _)
int main(int argc, char *argv[], char *envp[]) {
printf("You $HOME variable is: %s\n\n", getenv("HOME"));
TRACE;
return 0;
}
When I compile it I get this:
Code:
[ammullan@darkside Programming]$ gcc -o a -Wall a.c
a.c: In function `main':
a.c:10: `_' undeclared (first use in this function)
a.c:10: (Each undeclared identifier is reported only once
a.c:10: for each function it appears in.)
a.c:10: parse error before "_FILE_"
[ammullan@darkside Programming]$
Any ideas? As far as I can see the code's fine.....