CS21 Week4 Thursday In-Class Exercises

  1. Random Numbers. Lets look at the random library provided by the book together. Start by opening up the random.h header file in emacs or vim:
    % vi ~newhall/public/cs21/BookLibraries/random.h 
    

  2. Using the gdb (or ddd) debugger

    Make a gdb subdirectory in your cs21 subdirectory and copy over these files:

        % cd
        % cd cs21
        % mkdir gdb
        % cd gdb
        % pwd
        /home/your_user_name/cs21/gdb
    
        % cp ~newhall/public/cs21/gdb/* .
    
    We will start by looking at my Compiling and Debugging Tips for C page off the CS21 homepage. We will then go through some examples using gdb to debug the programs you copied over.