Sams Teach Yourself C in 21 Days

(singke) #1
Answers for Day 21

Quiz

1.Modular programmingrefers to the program development method that breaks a
program into multiple source-code files.


  1. The main module contains the main()function.

  2. To avoid unwanted side effects by ensuring that complex expressions passed as
    arguments to the macro are fully evaluated first.

  3. Compared to a function, a macro results in faster program execution but larger pro-
    gram size.

  4. The defined()operator tests to see whether a particular name is defined, returning
    TRUEif the name is defined and FALSEif it isn’t.

  5. You must use #endif.

  6. Compiled source files become object files with an .OBJ extension.
    8.#includecopies the contents of another file into the current file.

  7. An #includestatement with double quotes looks in the current directory for the
    include file. An includestatement with <>searches the standard directory for the
    include file.

  8. DATE is used to place into the program the date that the program was com-
    piled.
    A string containing the name of the current program, including path information.


Answers for Bonus Day 1

Quiz


  1. An OOP language is characterized by
    Polymorphism
    Encapsulation
    Inheritance
    Reuse

  2. Polymorphism

  3. None. All of the C commands can be used in a C++ program.


874 Appendix F

49 448201x-APP F 8/13/02 11:22 AM Page 874

Free download pdf