How multi line comments differ from single line comments | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How multi line comments differ from single line comments

Kindly don't add symbolic difference, explain the advantage.

21st Sep 2017, 1:27 AM
Rocky
Rocky - avatar
6 Answers
+ 6
Multiline comments can be done as // comment line 1 // comment line 2 // comment line 3 and they don't accidentally go too far. /* comment 1 x++; /* comment 2 */ In this example, x doesn't get incremented. Given the number of times in Pascal code these bugs slipped in a huge project I worked on, I refuse to use them, unless I truly need an inline comment.
21st Sep 2017, 2:40 AM
John Wells
John Wells - avatar
+ 8
Actually, there is one reason I used a multiline comment. c = 3.14 /* pi */ * 2 * r; It lets you sneak a comment within a code statement.
21st Sep 2017, 1:45 AM
John Wells
John Wells - avatar
+ 7
It is easy to forget to close the multiline comment and end up having code you believe is executed not be. Otherwise, there isn't a difference.
21st Sep 2017, 1:41 AM
John Wells
John Wells - avatar
+ 3
Multiline comments can be more than one line, single libe comments can be used in a single line before it starts a code again
21st Sep 2017, 2:23 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
ok thank you.
21st Sep 2017, 1:42 AM
Rocky
Rocky - avatar
0
Got it so it cleared the concept.
21st Sep 2017, 5:26 AM
Rocky
Rocky - avatar