Running SOS in C or C++ under UNIX


Download the file appropriate for the compiler you are using and for whether you are writing C or C++.

     To create an executable program and generate output:

1. Copy sos.o to your current directory.

2. Using vi or another editor, write your project and save it in a file called os.c.

3. Make sure that sos.o and os.c (or copies) are in the same (main) directory of the disk.

4. Make the directory containing both sos.o and os.c your current directory.

5. To compile the program, type the following:

     acc os.c sos.o

If compilation is successful, an executable file will be created, called a.out.

6. Rename a.out as sos by issuing the following command:

     mv a.out sos

7. To execute the program and generate output:

    a) To send output to the screen, type the following:

        sos

    b) To send output to a file called fn.o, type the following:

        sos > fn.o

Choose your own legal UNIX file name instead of fn.o.

To print the file fn.o, type the following:

       lpr fn.o

   c) To send output directly to the printer, type the following:

      sos | lpr