answersLogoWhite

0


Best Answer

In C++, you can write comments two different ways. The old way, which is C compatible, is to bracket the commented text with /* and */. These comment operators extend across lines. The new way, for C++, is the single line comment. You start the comment with //, and everything from that point to the end of the current line is a comment.

Note: You can use the preprocessor as well:
#if 0
Many many lines of comments
#endif
User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

A comment in C++ is all of the text between /* and */, which can span multiple lines, or all of the text between // and the end of the line. In both cases, a comment is not recognized if the symbol is contained with a literal quoted string.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

There are two types of comments used in C++.

The old (C) style comment is a block of text begun with /* and ended with */. Everything in between, including end-of-line sequences, is considered to be white space.

The new (C++) style comment is a block of text begun with // and ended with end-of-line. Everything in between is considered to be white space.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

1. between /* and */

2. between // and end-of-line

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Definition of comments in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Definition of coments and its types in c plus plus?

Comments in C++ always begin with // and extend to the end of the line. Multi-line comments must have // on each line. Any text that follows this symbol up to the newline character is completely ignored by the compiler. You can also use C-style comments, where multi-line comments can be enclosed within opening /* and closing */ markers. This type of comment can also be used to insert a short comment between C++ expressions upon the same line. Again, the compiler ignores everything, from the opening /* marker up to the closing */ marker. All comments are stripped from your source during preprocessing, at the point where macros are processed (also known as precompilation). The resulting intermediate file is the file that is actually compiled.


What are its program components?

the main() function,the#include Directive, the variable definition. function prototype, program statements, the function definition,program comments and braces are the components of program in C++


What is comment variable in c plus plus?

Comments and variables are two different things. They are so different the question does not make sense. Perhaps you should restate the question, giving us more details as to what you are looking for?


Can you declare a method within a method in c or c plus plus?

C: there are no methods in C. C++: no.


How can you add a comment in a JavaScript?

Javascript uses C-style comments, for block comments (multiline) use: /* comments go anywhere in here */ for short one line comments use double-slash: // this is also a comment

Related questions

What is definition of employee code in c plus plus?

la la land


What is the difference between declaration and a definition in c plus plus?

A declaration is an incomplete type whereas a definition is a complete type.


Definition of coments and its types in c plus plus?

Comments in C++ always begin with // and extend to the end of the line. Multi-line comments must have // on each line. Any text that follows this symbol up to the newline character is completely ignored by the compiler. You can also use C-style comments, where multi-line comments can be enclosed within opening /* and closing */ markers. This type of comment can also be used to insert a short comment between C++ expressions upon the same line. Again, the compiler ignores everything, from the opening /* marker up to the closing */ marker. All comments are stripped from your source during preprocessing, at the point where macros are processed (also known as precompilation). The resulting intermediate file is the file that is actually compiled.


What are its program components?

the main() function,the#include Directive, the variable definition. function prototype, program statements, the function definition,program comments and braces are the components of program in C++


What is the technical definition of architecture?

a squared plus b squared is c squared


Definition of Looping in c and c plus plus?

Looping means you repeat a particular procedure a specified number of times or until a defined condition is met.


What is the purpose of using comments in c plus plus?

Comments are to help other programmers (or yourself in the future) to understand what is going on in a program, especially when the code itself is complicated and may not be obvious. More time is spent maintaining and improving programs than original development, so leaving clear comments is very important!


Do compiler see the comments written with in the C programming?

It ignores the comments, those are for the human reader.


What is comment variable in c plus plus?

Comments and variables are two different things. They are so different the question does not make sense. Perhaps you should restate the question, giving us more details as to what you are looking for?


Consumption Expenditures plus Investment plus Government Expenditures .?

GNP


What is b plus b plus b plus c plus c plus c plus c?

b+b+b+c+c+c+c =3b+4c


What is c plus c plus 2c plus c plus c equal?

c + c + 2c + c + c = 6c