Programming I version 1.5.3
Programming I C Library
Loading...
Searching...
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:
prog1lib-1.5.3.zip

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
unzip prog1lib-1.5.3.zip
cd prog1lib/lib
make
cd ../script_examples
make celsius_to_fahrenheit
./celsius_to_fahrenheit

Detailed Steps for MinGW on Windows

  • Download the library and save it in your MinGW home directory:
    C:\MinGW\msys\1.0\home\MyUserName
  • Start the MinGW shell by double-clicking
    C:\MinGW\msys\1.0\msys.bat
  • 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:
    unzip prog1lib-1.5.3.zip
    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:
    make
  • Change to the script examples directory:
    cd ../script_examples
  • Compile the example:
    make celsius_to_fahrenheit
  • Execute the example:
    ./celsius_to_fahrenheit
    or
    celsius_to_fahrenheit.exe
  • 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