CPSC 335 Quiz 3

Answer the following questions with a few sentences.

  1. Why is it recommended to always use curly braces for blocks, even when they consist of a single statement?
  2. What's the main difference between a while loop and a do-while loop?
  3. What's the "global namespace" in C++?
  4. When breaking code into multiple files, we generally need to make .h and .cpp files. What goes in each?
  5. What's the reason to have a "header guard"?