Exercises

 < Day Day Up > 

1.

What function does every C program have? Why should you split large programs into several functions?

2.

What command could you use to compile prog.c and func.c into an executable named cprog?

3.

Show two ways to instruct the C preprocessor to include the header file /usr/include/math.h in your C program. Assuming that the declar.h header file is located in the subdirectory named headers of your home directory, describe two ways to instruct the C preprocessor to include this header file in your C program.

4.

How are the names of system libraries abbreviated on the gcc command line? Where does gcc search for libraries named in this manner? Describe how to specify your own library on the gcc command line.

5.

Write a makefile that reflects the following relationships:

  1. The C source files transactions.c and reports.c are compiled to produce an executable accts.

  2. Both transactions.c and reports.c include a header file accts.h.

  3. The header file accts.h is composed of two other header files: trans.h and reps.h.

6.

If you retrieve version 4.1 of the file answer for editing and then attempt to retrieve the same version again, what will CVS do? Why is CVS set up this way?

     < Day Day Up > 


    A Practical Guide to LinuxR Commands, Editors, and Shell Programming
    A Practical Guide to LinuxR Commands, Editors, and Shell Programming
    ISBN: 131478230
    EAN: N/A
    Year: 2005
    Pages: 213

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net