Skip to main content Link Search Menu Expand Document (external link)

C basic Structure

An example of a typical c program is:

#include <stdio.h>
//one way to comment
/* block comment*/
int main() {
    printf("Hello World");
    return 0
}

Important to remember:

  • main is always an integer function, and should return 0 when everything is OK
  • #include is a preprocessor directive to include libraries

Back to Index