Arduino Programming: Comment Syntax



To make our code more readable and easy for others to understand, we need to make some statements that to be ignored or not to be complied by the machine.

Arduino comment syntax is exactly same as C/C++, we use // for single line comment and /* */ for multi-lines comments.

Here is a sample comment syntax for both single and multi-lines:

intCount=0; //this is a single line comment
            //anything after the slashes are comment

/* this is multi-lines comments, 
// it uses to block out the whole blocks of code.
// single line comment can be in multi-lines comments.

if intCount==0 {
  intCount = intCount + 1;
}
// don't forget to end the comment
*/

< BACK

This entry was posted in Software and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>