What are the different types of comments allowed in c++?



What are the different types of comments allowed in c++?..

Answer / Neeraj Kumar Tomar

"C++ supports three types of comments:
1. Single-line comment: // This is a single-line comment
2. Multi-line comment: /* This is a multi-line comment */
3. C++/C style comments: /*This is a C++/C style comment*/ and the closing tag can be placed on a new line or omitted, but it's not recommended in C++"

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Can I learn c++ in a week?

1 Answers  


What is the difference between equal to (==) and assignment operator (=)?

1 Answers  


What is "strstream" ?

1 Answers   Huawei,


Explain the operation of overloading of an assignment operator.

1 Answers  


What is a container class? What are the types of container classes in c++?

1 Answers  


Why cout is used in c++?

1 Answers  


What are the c++ access specifiers?

2 Answers  


Describe linkages and types of linkages?

1 Answers  


What is a vector c++?

1 Answers  


Differentiate between an array and a list?

1 Answers  


Write a program in c++ to print the numbers from n to n2 except 5 and its multiples

1 Answers   Cankaya University,


What is the output of this prog. ? struct A { A(){ cout << \"A\"; } }; struct B { B(){ cout << \"B\"; } }; struct C { C(){ cout << \"C\"; } }; struct D { D(){ cout << \"D\"; } }; struct E : D { E(){ cout << \"E\"; } }; struct F : A, B { C c; D d; E e; F() : B(), A(),d(),c(),e() { cout << \"F\"; } };

2 Answers  


Categories