Understanding Hello World




If you are already familiar with the C coding and syntax, you may like to skip this page and go to the next page in tutorial. Otherwise read on.

Here is the code reproduced again

  1. #include <stdio.h>
  2. int main(){
  3. printf("Hello World from Referencedesigner.com\n");
  4. return 0;
  5. }


The first line
  1. #include <stdio.h>

Includes a library file called stdio.h which is used primarily for supporting console input and output function. In our case, this output on console is printed using the printf statement

  1. printf("Hello World from Referencedesigner.com\n");


If you are wondering what is \n in the printf - then the short answer is - it adds a new line to the output. The entry point to the program is defined using the keyword main(). The code written between the curly brackets { and } is executed. The keyword int before the main() signifies that our program returns an integer. For now it is not used.

  1. int main()
  2. {
  3. }


Finally, the statement

  1. return 0;


says that our program returns and interger value 0. We will come to that later.

This is a quick overview of the objective C, Hello world program.