S
saurabh29789
I tried this code :
/* File1.c */
#include<stdio.h>
#define _q "
int main()
{
printf(_q ABC _q );
return 0;
}
After executing the following :
gcc -E File1.c
, I get
int main()
{
printf(" ABC ");
return 0;
}
This shows that the macro is expanded as required, but when compiled
=> gcc File1.c gives following errors:
1. Missing terminating " character
2. Missing terminating " character
3. 'ABC' undeclared
Why am I getting the errors even if the expansion is done as was
required ??
/* File1.c */
#include<stdio.h>
#define _q "
int main()
{
printf(_q ABC _q );
return 0;
}
After executing the following :
gcc -E File1.c
, I get
int main()
{
printf(" ABC ");
return 0;
}
This shows that the macro is expanded as required, but when compiled
=> gcc File1.c gives following errors:
1. Missing terminating " character
2. Missing terminating " character
3. 'ABC' undeclared
Why am I getting the errors even if the expansion is done as was
required ??