Comments in C

For Complete YouTube Video: Click Here

In this class, we will understand Comments in C.

The comment plays a vital role in writing ‘big’ programs.

The comments are given in the program to help the third person understand what’s happening in the program.

Comments in C

Comments clarify the C source code, allowing others to understand better what the code was for and greatly help debug the code.

We can comment in two different ways.

  1. Multi-line comments
  2. Single-Line Comments

Multi-line and Single-line Comments

The image below is a program that illustrates multi-line and single-line comments.

Comments in C
Comments Example

The syntax for multi-line comment is /* comment here */.

Usually, multi-line comments are to elaborate a function. 

The syntax for single-line comments is two forward slashes. //Comment Here.