The comments are the only text the programming language that are not going to be compiled by the compiler. They can be used to a better understand of your code, to easily read it.
The comments can be also used to not a execute a part of a program, to try an instruction for example.
We will see how to comment one line on the Arduino language. To do that we use double slash that way:
int count =0; // Your comment
The double slash can be also used to comment a command line, to make a test for example:
// int count =0; This line is a comment
Nevertheless it is possible that you need to comment multiple lines. To do that we will use an another instruction.
To comment multiple lines, we will star slash:
/*This is a comment *//*
This is another comment */
As you have seen, thank to the slash star you can comment one or more lines.
We will see now an example in which we comment multiple lines:
void setup(){
Serial.begin(9600);
/* This is the beginning of the comment of multiple lines
int count = 0;
do {
delay(50);
count+=1;
Serial.println(count);
} while (count < 100);
End of the comment*/
}
void loop(){
}