Explain comments in c++, C/C++ Programming

Assignment Help:

Comments

Comments are integral part of every program . Comments help in coding, debugging and maintaining a program . The compiler ignores them. They should be used liberally in the program .

In C++, a comment begins with two forward slashes ( // ) and ends with the end of that line. A comment can start at the beginning of the line or on a line following the program statement. This form of giving comments is certainly useful for the short line comments. If a comment continues on more than a line, the two forward slashes should be given on every line.

The C style of giving a comment is also available in C++. This style ( /*....*/) is mainly useful when the comment spans more than a line.

e.g.

                void main()

                 {

                                /* this is a good old style of giving

           a comment. It can be continued to

next line and has to be ended with */

 

                      clrscr();           // Clears the Screen

                                 init()_; // Initialize variables.

                                                :

                                :

                 }

 


Related Discussions:- Explain comments in c++

Define statements to define the constants, the problem description. The ...

the problem description. The order of the C Program should be as follows: Variables and constants Use #define statements to define the constants. Use arr

What does extern "c" int func(int *, A: This will turn o_ "name mangling" f...

A: This will turn o_ "name mangling" for func so that one can connect to code compiled by a C compiler.

Functions, Define  F u n c t i o n?  T h e r e a r e t...

Define  F u n c t i o n?  T h e r e a r e t w o t y p e s o f f u n ct i o n b u i l t - i n f un ct i o n s a n d u

Described storage qualifiers in c++ ?, A: They are following: Const: poi...

A: They are following: Const: point out that memory once initialized, must not be modify through a program. Volatile: denote that value in the memory location can be modified

What does this mean that "friendship isn''t transitive, What does this mean...

What does this mean that "friendship isn't transitive, inherited or reciprocal"? A: As I grant you friendship access to me doesn't grant your kids automatically access to me, do

C program for multiplication table , C Program for MULTIPLICATION TABLE ...

C Program for MULTIPLICATION TABLE   main() {           int a, b=1, c, d;           char ch;           clrscr();           while(ch!='n')           {

Example of pointers, #include "stdafx.h" #include iostream using name...

#include "stdafx.h" #include iostream using namespace std; int _tmain(int argc, _TCHAR* argv[]) {             int NumbHold[5];             int * ptrNumb;

Basic data type in cpp, B a s i c D a t a t y p e : ...

B a s i c D a t a t y p e : T h e r e a r e t h r e e t y p e o f d a t a t y p e i n C+ + 1.       P r

Padovan sequence, write a program that counts the number of occurrences of ...

write a program that counts the number of occurrences of the string in the n-th Padovan string P(n)

Inheritance, example of program to ad two numbers

example of program to ad two numbers

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd