C Basics

Comments

User Rating:  / 6
PoorBest 

Comments should be used generously in the source code to make it readable.

Comments are categorized in two following ways:

1)    Begin with /* and end with */

Every statement between /* and */ will be considered as comment.

     2)    Begin with // and with the next line character

It comments entire line begin with //

E.g.

#include <stdio.h>
int main()
{
	/* This is Type-1 Comment
	It is also called multi line comment. */
	int i; // Declare variable i, Type-2 Comment
	printf(“Hello World!”);
	return 0;
}

Note: -  Comments cannot be nested.

             For example, /* Cal of SI /* Author John date 03/03/2013 */ */ is invalid. 

 

 
 
 

                                                                                          About Us  ||  Contact Us  ||  Terms & Conditions  ||  Privacy Policy 

Referral Banners