Question 1.18 after cPP primer class

cPP primer after-class questions:

Exercise 1.8

indicate which of the following statements are valid, if any

std::cout << "/*";
std::cout << "*/";
std::cout << /* "*/" */;
std::cout << /* "*/" /* "/*" */;

predict the results of compiling these statements, actually compile these statements to verify your answers, and correct each compilation error.
.
looked at the answer to the after-class question and looked confused. I would like to ask you why there is such a hint during the compilation of the third sentence:
hello.cc:7:5: error: missing "character

at the end"
 std::cout<</* "*/" */;

modify to the following

std::cout<</* "*/" */";

correct, there are three quotation marks, do not match, what is the principle, kneel for explanation.

CPP
Mar.25,2022

after adjusting the formatting, the syntax highlighting has explained everything. I wonder if you understand.

Menu