Page 28 - C-Language
P. 28
• POSIX API (covering for example PThreads, Sockets, Signals)
Versions
Version Standard Publication Date
K&R n/a 1978-02-22
C89 ANSI X3.159-1989 1989-12-14
C90 ISO/IEC 9899:1990 1990-12-20
C95 ISO/IEC 9899/AMD1:1995 1995-03-30
C99 ISO/IEC 9899:1999 1999-12-16
C11 ISO/IEC 9899:2011 2011-12-15
Examples
Hello World
To create a simple C program which prints "Hello, World" on the screen, use a text editor to create
a new file (e.g. hello.c — the file extension must be .c) containing the following source code:
hello.c
#include <stdio.h>
int main(void)
{
puts("Hello, World");
return 0;
}
Live demo on Coliru
Let's look at this simple program line by line
#include <stdio.h>
This line tells the compiler to include the contents of the standard library header file stdio.h in the
program. Headers are usually files containing function declarations, macros and data types, and
you must include the header file before you use them. This line includes stdio.h so it can call the
function puts().
https://riptutorial.com/ 4

