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++

Decoding, Smugglers are becoming very smart day by day. Now they have devel...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

C program to display the contents of file on a screen, Program is to displa...

Program is to display the contents of file on a screen: Write a program to display the contents of file on a screen void main()   {  clrscr();  ifstream fin("ascii

Bubble sort c program, Bubble sort C program: Write a program to defin...

Bubble sort C program: Write a program to define a bubble sort. void main()  {   clrscr();   int a[100],ch,n;   cout   cin>>n;   for (int i=0;i

Program to find shortest path between two nodes, Ques.Implement a c/c++ pro...

Ques.Implement a c/c++ program to find a shortest path between two nodes in a network?network should be taken as an adjacency matrix.

Boolean functions and simple logic design, The digital signal is one which ...

The digital signal is one which only consists of two states i.e. logic '1'   (+5 volts) and logic '0' (0 volts). Various electronic blocks use logic and these form the basis of a m

Constructors and methods program, To complete this assignment, edit the fol...

To complete this assignment, edit the following constructors and methods: 1. public MaxPQ(Key[] keys) - change the following loop for (int k = N/2; k >= 1; k--) sink(k);

Palindrome, A palindrome is a string that reads the same from both the ends...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Explain manipulators, Manipulators There are several classes in the ios...

Manipulators There are several classes in the iostream.h header file. One of them is ios class. This class stores the format state. For example, some bits explain the base in w

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