Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

what is the use of single line comments and multiline comments in C++?

+4 votes
asked Feb 23, 2025 by Durganshi Pandey (160 points)

1 Answer

0 votes
answered Feb 27, 2025 by Peter Minarik (101,340 points)
As the name suggests, you can render a line to be a comment, or multiple one. Whatever you need.

These days, you can use IDEs that can place multiple "single line comments" at the same time, so these days there are not many differences.
commented Mar 14, 2025 by Nahorny (110 points)
one line: //
more lines: /*dsadsadsadsadasdad
dasdsadsadad*/
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...