CodesandTutorials
Next generation website theme is here (black, neon and white color) - Reduces eye strain and headache problems.
You are here - Home > Programming > C > Basics

Comments


Definition

Comment is a statement of one or more lines written by the programmer to understand himself and others, what the code is all about.

Types

Comments are declared in two ways :

  • One line comments starts with double slash symbol "//" and terminates at the end of line.
  • Two or more line comments starts with slash star "/*" and ends on same line or next lines with star slash symbol "*/".

Example :

  • // this is one line comment
  • /* this is
  • a multiline
  • comment */

Description

  • Comments are written by the user to understand the source code for himself and others.
  • User can write comments any number of times in the program at any place.
  • Its good to write comments to specify the reason for using a certain statement or expression.
  • Compiler rejects these comments, so they didn't get added to the executable file.

Tip Box

Its very good habit of writing comments in a program.


Advertisement





Terms of Use | Privacy Policy | Contact Us | Advertise
CodesandTutorials © 2014 All Rights Reserved