1.3 AWord about Comments (3)

2013-10-07 16:13:37 · 作者: · 浏览: 81

EXERCISES SECTION 1.3

Exercise 1.7: Compile a programthat has incorrectly nested comments.

Exercise 1.8: Indicate which, if any, of the following output statements are legal:

  1. std::cout << "/*";   
  2. std::cout << "*/";   
  3. std::cout << /* "*/" */;   
  4. std::cout << /* "*//* "/*" */;  

After you’ve predicted what will happen, test your answers by compiling a program with each of these statements. Correct any errors you encounter.