Programming I version 1.5.3
Programming I C Library
No Matches
Programming I

The Programming I C Library defines basic data types and functions to simplify C programming for beginners and to enable the step-by-step design approach outlined in the script. It contains facilities for testing code, e.g., functions for comparing actual and expected return values.

Download and Installation

Download the library with examples from the script:

Extract the zip file, go to directory prog1lib/lib, make libprog1.a, go to directory prog1lib/script_examples, make celsius_to_fahrenheit (or any other example from the script). In more detail, assuming that you have opened the terminal (on Linux or Mac) or installed MinGW (on Windows, including the bin class of msys-wget, msys-zip, msys-unzip), perform these steps:

cd DirectoryToWhichYouDownloadedTheLibrary
cd prog1lib/lib
cd ../script_examples
make celsius_to_fahrenheit

Detailed Steps for MinGW on Windows

  • Download the library and save it in your MinGW home directory:
  • Start the MinGW shell by double-clicking
  • The MinGW shell starts in your MinGW home directory. List its contents:
    ls -l
    The library zip-file should be in the list.
  • Unpack the zip-file to generate the prog1lib directory:
    If unzip is not available, install it via the MinGW setup. (See the exercise slides for more details.)
  • Change to the lib directory:
    cd prog1lib/lib
  • Compile the library:
  • Change to the script examples directory:
    cd ../script_examples
  • Compile the example:
    make celsius_to_fahrenheit
  • Execute the example:
  • To compile other examples, only perform the last two steps again. They may be combined:
    make wages && ./wages

Header Files

Functions for output, input, testing, assertions, etc. contained in base.h.

Overview of all files