User Tools

Site Tools


cs_lang:c

This is an old revision of the document!


Learning C

Simple examples

/* Hello World program */
 
#include<stdio.h>
 
main()
{
    printf("Hello World");
 
 
}

Compile and run the program: <code bash> $ gcc -Wall hello.c -o hello.out hello.c:6: warning: return type defaults to ‘int’ hello.c: In function ‘main’: hello.c:10: warning: control reaches end of non-void function

$ ./hello.out Hello Worldcedric <code>

cs_lang/c.1310459402.txt.gz · Last modified: 2011/07/12 10:30 by cedric