Re: c preprocessor expansion

Nicholas Mc Guire <[email protected]>
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
>
>
> #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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.