int main() {
int linux = 701;
printf("%d", linux);
return 0;
}
Simple enough. : Really?
I put it into the code.c
I now compile and run it:
$ gcc code.c && ./a.out
Bad! Compile failed, and receive the following error message:
code.c: In function'main':
code.c:4:6: error: expected identifier or'('before numeric constant
int linux = 701;
^
Confusing!!
After Googling this error information – this is the error code needs to be preprocessed.
So, I bring the-e argument at compile time, it can compile stops after preprocessing:
$ gcc -E code.c
Preprocessed main () function code appears as follows:
int main() {
int 1 = 701;
printf("%d\n", 1);
return 0;
}
I passed out! C-language editor of preprocessing Linux changed the variable the integer 1. When the compiler encounters an int 1=701; statement, throws an error.
Now, I'm no Linux assign any values to variables:
#include
int main() {
printf("%d\n", linux);
return 0;
}
To compile and run:
$ gcc code.c && ./a.out
It compiles successfully and the output:
1
Turns out, Linux is Number1