Sams Teach Yourself C++ in 21 Days

(singke) #1
What’s Next 789

21


Exercises ........................................................................................................



  1. Write the inclusion guard statements for the header file STRING.H.

  2. Write an assert()macro that prints an error message and the file and line number
    if debug level is 2, that prints a message (without file and line number) if the level
    is 1, and that does nothing if the level is 0.

  3. Write a macro DPrintthat tests whether DEBUGis defined and, if it is, prints the
    value passed in as a parameter.

  4. Write the declaration for creating a month, day, and year variable all stored within
    a single unsigned intvariable.

Free download pdf