Re: c preprocessor expansion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
>
> #define FOO "bar"
>
> int main() {
>    printf(FOO);
> }
>
> It will output this:
>
> int main() {
>    printf("bar");
> }
>
gcc -E file.c
hofrat@rtl14:~/stuff$ cat file.c
#define FOO "bar"

int main() {
   printf(FOO);
}

hofrat@rtl14:~/stuff$ gcc -E file.c
# 1 "file.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "file.c"


int main() {
   printf("bar");
}


hofrat
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux