We'll do a quick description of what each line does. Don't worry if your not sure about some parts, we'll do plenty more examples.include information about how to use the functions from the Standard Device Input/Output library. Usually the standard input device is your keyboard and the standard output device a terminal (which is displayed on your monitor. This library is very widely used, we'll come across a lot of functions from it in this book.returns an integer (a positive or negative number with no decimal point). We tell the compiler to expect this by preceding the definition of main() with int. When returning from main() it is convention to return zero if no problems were encountered.
The two lines that make up the body of main() are known as statements. More specifically they are simple statements (as opposed to compound statements which we will encounter in chapter 4). Statements are to C what sentences are to spoken languages. A semi-colon ends a simple statement. The blank lines in the program are optional, C never requires a blank line but they make code much easier to read.
We mentioned that our function main() returns the value zero. For most functions the return value can be used within the program but since returning from main() signals the end of the program it returns it to the shell. The return value of a program is stored by the shell, if you want to see it, type the following:
ciaran@pooh:~/book$ gcc -Wall -o hello hello.c ciaran@pooh:~/book$ ./hello hello, world ciaran@pooh:~/book$ echo $? 0 ciaran@pooh:~/book$