C is a standard programming language.
Depending on your computer, you may invoke the C compiler by a command like cc, gcc or xlc.
C++ examples are available.
The F77 directory includes some examples on features of the FORTRAN77 language.
FORTRAN90 examples are available.
MATLAB_C contains examples in which a MATLAB program calls a C function, using MATLAB's MEX facility.
MIXED shows some examples of writing a program partly in C and partly in some other language.
ARRAYS is a very simple example of how to set up arrays in C++. In particular, we note that vectors are easy to declare with fixed or dynamic dimensions, but that arrays of dimension 2 or greater aren't easy to declar dynamically. The example shows how to work around by settting up a two dimensional array as a one dimensional vector. Files you may copy include:
HELLO is just a "Hello, world!" program. Files you may copy include:
NOT_ALLOCATED_ARRAYS shows that you should initialize your array pointers to NULL, and reset them to NULL after you delete your arrays. Otherwise, an unallocated or delete array is liable to have a deceptive nonnull value! Files you may copy include:
POISSON solves the Poisson equation on a 2D grid. The program uses dynamically allocated doubly dimensioned arrays, and includes routines to allocate and free the associated memory.
RANDOM_NUMBERS shows how to use the standard library routines SRAND to set the seed and RAND to return random numbers.
SIZES prints out the sizes of various datatypes. Files you may copy include:
You can go up one level to the C source codes.