> ## Content Index
> Fetch the complete content index at: https://developerinsider.co/llms.txt
> Use this file to discover other available public pages before exploring further.

# Comments line in C++
- URL: https://developerinsider.co/comments-line-in-cpp/
- Published: 2016-06-02T16:14:00.000Z
- Updated: 2018-03-29T17:00:50.000Z
- Author: Anit Kumar
- Tags: Primary, C++

Comments are explanatory statements that you can include in C++ code to explain what the code is doing. The compiler ignores everything that appears in the comment,so none of that information shows in the result.

**Single-Line Comments:**  
Comments that require lines begin with `//`. You can place them on the single line

**For example:**

```
#include<iostream.h>
using namespace std;
int main()
{
     //prints "Hello world"
     cout<<"Hello world";
     return 0;
}

```

**Output:**

```
Hello world

```

**Multi-Line Comment:**  
Comments that require lines begin with `/*` and end with `*/`.  
You can place them on the same line or insert one or more lines between them.  
**For example:**

```
#include<iostream.h>
using namespace std;
int main()
{
     /*This is a comment.
     prints "Hello world" */
     cout<<"Hello world";
     return 0;
}

```

**Output:**

```
Hello world

```

**Note:-**  
Comments can be written anywhere, and can be repeated any number of times throughout the code.