What is the output of this C code?
#include
#define a 10
int main()
{
const int a = 5;
printf("a = %d\n", a);
}
Answer: C
The #define substitutes a with 10 leaving no identifier and hence compilation error.
Output:
$ cc pgm3.c
pgm3.c: In function ‘main’:
pgm3.c:5: error: expected identifier or ‘(’ before numeric constant