C + + Primer fourth Edition after-school practice solution Exercise 1.8

Source: Internet
Author: User

Note: This essay is directly transcribed in the C++primer (fourth edition) Exercise solution (full version). Here is mainly for the convenience of my repeated reading later.

Exercise 1.8

Indicates that the following output statements are valid (if any).

    " /* " ;     " */ " ;     /*  " */ "  */;

Predict the results, and then compile the program that contains the three statements above to check your answers. Correct the errors encountered.

Troubleshooting

The first and second statements are legal.

In the third statement, after the << operator, the part of the third double quotation mark is commented out, causing the right operand of the << operator to be not a complete string, so it is not legal. You can correct this by adding a double quotation mark before the semicolon.

C + + Primer fourth Edition after-school practice solution Exercise 1.8

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.