ANSI C Workshop

We offer a series of courses designed to introduce ANSI C programming with automated memory management for the purpose of writing robust, efficient, and portable code for general purpose, including the reuse of legacy of legacy code written in a language other than C. All necessary training material will be included in the courses in the form of source code, source skeletons, and pdf files.

One of the most difficult parts of C programming is the proper use of the functions malloc (to dynamically allocate memory), free (to free up memory that has been previously allocated dynamically), and realloc (to increase the size of memory that has been previously allocated dynamically). Automated memory management is one of the features that make languages like Java and LISP desirable. Fortunately, very efficient automated memory management routines are now available as libraries for ANSI C. We will introduce a memory management library that eliminates the need to call free. In fact, only one function named theAllocFun is used (roughly equivalent to Java's new function). Automated memory management makes C programming a lot easier (if not actually enjoyable!).

Several excellent memory management libraries are now available in the public domain and commercially. This course is designed so that any good management library can replace another in use by simply changing one macro definition (as will be explained), so the actual workings of the library need not be of any concern.

It is not assumed that the student is familiar with ANSI C, but only that he or she has some familiarity with some modern programming language.

The first in the series of courses is:

Course number PGM 08

I. Basic ANSI C Programming with Automated Memory Management

Each example listed below is covered in detail in the course. First the mathematical concepts are discussed and that work is used to develop algorithms and pseudo code. More and more of the ANSI C language is covered by carefully translating from pseudo code to C in clear steps. Other quick examples to illustrate various points will be interspersed with the main examples.
The first example introduces some basic operations, logical testing and branching as well as recursion. The second example introduces arrays, basic output, looping and the concept of header files and "main" program. The third example reinforces the earlier ideas and introduces passing functions as arguments to other functions. The fourth example also builds on the previous material and adds automatic memory management and return values in function arguments. Finally, we discuss standard linkage conventions for C and Fortran interlanguage communication.
In addition, there will be an introduction to the C debugger.

Course number PGM 09

II. Intermediate ANSI C Programming, the Construction of Libraries and, an Introduction to Web Programming

Other courses in this series are available.

Use the "back buton" to return to the previous page.
MSSRC 2017