Lab 12
Those Dreaded
Pointers

Objectives

The objectives of this lab are to become familiar with using pointers in C. Once again we will be using a makefile to build these programs; however, this time you must write the makefile yourself from scratch (1 Point). (Hint: the easiest way to do this is to copy a makefile from a previous lab and modify if). Your makefile should properly compile and link the source files needed to make the three programs described below. The commands we will use to compile your programs are:

          make swap
          make swapbig
          make reorder

You will also need data to test the second and third programs below. You should create your own data files that verify that your functions work correctly under all conditions (1 point). We will run your programs with the following commands:

          swapbig < swapbig.dat
          reorder < reorder.dat

Programs

What You Turn In

Use the "grade" command to turn in the all of the source and data files (.c,.h, and .dat files) and the makefile in your Lab12 directory. You will turn in your trace of the first problem on paper to the TA BEFORE leaving the lab. Make sure you have your name and login id on the paper. Your command will look like the following. If you are in Section 001 use:

            grade -lab12s1,ee160  *.c *.h *.dat  makefile

If you are in Section 002 use:

            grade -lab12s2,ee160  *.c *.h *.dat  makefile

If you are in Section 003 use:

            grade -lab12s3,ee160  *.c *.h *.dat  makefile

If you are in Section 004 use:

            grade -lab12s4,ee160  *.c *.h *.dat  makefile

You should verify that you turned in things successfully, which you can do with the command (which simply leaves the file names off from the previous command).
            grade -lab12s1,ee160

            OR

            grade -lab12s2,ee160

            OR

            grade -lab12s3,ee160