Is there any any method to close single line comment? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 10

Is there any any method to close single line comment?

14th Apr 2017, 3:38 PM
Gaurav bhojwani
Gaurav bhojwani - avatar
3 Answers
+ 6
You can't close single line comment but you can use multi lines comments in a single line like this : std::cout /*we are going to output*/ << /* something */ "Like that" << std::endl /*(don't forget the semicolon ^^)*/; //and a single line comment you can not close ! Edit: if you want a single line comments that begins at the end of the line so in fact there is no need to close it as said by Pixie but if you just want to insert comments in one line between expressions, using multiline comments can be a solution.
14th Apr 2017, 3:58 PM
Glozi30
Glozi30 - avatar
+ 7
No. There isnt a need to close a single line comment tho
14th Apr 2017, 3:41 PM
Pixie
Pixie - avatar
+ 5
No as a single line comment lasts to the end of line
14th Apr 2017, 3:46 PM
Tamás Barta
Tamás Barta - avatar