Exercises


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 file named accts.

  2. Both transactions.c and reports.c include a header file named 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?




A Practical Guide to UNIX[r] for Mac OS[r] X Users
A Practical Guide to UNIX for Mac OS X Users
ISBN: 0131863339
EAN: 2147483647
Year: 2005
Pages: 234

Similar book on Amazon

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