O'Reilly logo

C Programming: Visual Quickstart Guide by Marc Liyanage, Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Basic Syntax

Creating a C source file is simple, as long as you follow the standard syntax. A C document is just plain text—written in practically any text editor—with a .c file extension. The basic syntax of a minimal C file is

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

The first line states that the stdio.h package should be included (this is a preprocessor directive, which you'll learn about in Chapter 8, “Using the C Preprocessor”). Including stdio.h has the same effect as making that file's contents part of this document (but without the extra typing or lines of code). The stdio.h file, which stands for standard input/output, brings fundamental functionality—such as the ability to take input from a keyboard and display output on ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required