Hi,
I am trying to pass a string to a MACRO using -D option in gcc. I am not getting desired output, below is snippet, please let me know what I am missing.
$ gcc -o finame -D CORE="op1_log.txt" finame.c
#define STR(x) x
int main()
{
FILE *fp;
char filename[30];
strcpy(filename,STR(CORE));
fp = fopen(filename,"w");
printf("%s\n",filename);
if(fp == NULL)
printf("Can not open File\n");
}