Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(void)
- {
- int i;
- i = 2; /* assign the value 2 into the variable i */
- printf("Hello, World! The value of i is %d, okay?\n", i);
- return 0;
- }
- /* this is what it returns
- $ gcc beej05.c -o HelloWorld
- beej05.c: In function ‘main’:
- beej05.c:7:17: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
- printf("Hello, World! The value of i is %d, okay?\n", i);
- I believe this is identical to http://beej.us/guide/bgc/output/html/multipage/sve.html
- part 3.1 second example.
- His output differs from mine.
- according to the guide its supposed to print:
- Hello, World! The value of i is 2, okay?
- Googling for the warning shows this to be easily fixable with the include
- #include <stdio.h>
- gcc beej05.c -o HelloWorld
- ./HelloWorld
- Hello, World! The value of i is 2, okay?
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement