answersLogoWhite

0

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

15y ago

What else can I help you with?

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!


When matching each problem (term) with its sum or difference (definition). Match Term Definition 4.23 plus 16.21 A) 26.09 42.3 plus 1.621 B) 43.921 4.23 and minus 1.621 C) 20.44 42.3 and minus 16.21 D?

The term "4.23 plus 16.21" matches with definition A) 26.09. The term "42.3 plus 1.621" matches with definition B) 43.921. The term "4.23 and minus 1.621" matches with definition C) 20.44. The term "42.3 and minus 16.21" matches with definition D.


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

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


Consumption Expenditures plus Investment plus Government Expenditures .?

GNP


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?


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

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