+ 1
What is the use of comments in c++
7 Respuestas
+ 16
Hey Shobhit Jaiswal, Comments are explanatory statements that you can include in the C++ code to explain what the code is doing.
The compiler ignores everything that appears in the comment, so none of that information shows in the result.
A comment beginning with two slashes (//) is called a single-line comment. The slashes tell the compiler to ignore everything that follows, until the end of the line.
https://www.sololearn.com/learn/CPlusPlus/1605/
+ 1
You can write notes in the code so others can understand your code. A comment does not affect a code. It is only a comment.
+ 1
Comments are used to indicate what is going on the particular line of the code.
For e.g.
average (a,b,c); //function calling
Here, //function calling is the comment of the code and indicates that a function is being called.
0
Thanks Brothers
0
I'm sorry what was the question again
0
alice The question is "What is the use of comments in c++"
0
Comments are the statements that are ignored while compiling. C++ supports both single line and multi line comments.
You can use, the following methods to comment in c++:
1. Use // before a line and the compiler will understand that it is a comment.
2. Use /* sololearn */ and place the line instead of sololearn to make it a comment.
If you want to understand comments further, read this https://www.tutorialspoint.com/cplusplus/cpp_comments.htm