The programs posted here are written in C and can be compiled in Linux using gcc (GNU C Compiler). Most of the examples are simple and can be compiled using the following command
where progname.c is the filename of the source code and progname is the name of the resulting compiled output file. Without the "-o progname" option, the default output file name is a.out.gcc -o progname progname.c
When you play around with the examples, and compile your own version, it is suggested that you add the "-Wall" and "-Werror" switches to the compile command. The resulting compile command will be
The "-Wall" switch turns on all warnings while the "-Werror" switch turns all warnings into errors. This will make the compilation process halt on all warnings. This will help guide you in writing correct C code.gcc -o progname progname.c -Wall -Werror
To run your program, simple type
./progname
For programs which use special libraries (math, pthreads), the library used should be part as an argument to gcc. The "-lm" argument is used for math.h and "-lpthread" for those that use pthread.h.