Understanding the C Language Skeleton - dummies

Understanding the C Language Skeleton

By Dan Gookin

Part of Beginning C Programming For Dummies Cheat Sheet

Most coding starts with a C language structure. This skeleton includes the basic bones upon which most programs are written. Use this simple skeleton to get started:

#include <stdio.h>
int main()
{
    return(0);
}

Traditionally, the program begins with preprocessor directives plus prototypes. The #include statements bring in header files, such as stdio.h, the standard input/output header file.

The primary function in all C code is main(), which is the first function that’s run when the program starts. The main() function is an int function, so it must return an integer value. All the function’s statements are enclosed in curly brackets, or braces.