Thats what I noticed its good for, but, I have also noticed that in some instances on single line comments using /xxx/, if you place a /* or */ in the wrong spot, it can interfere with the code and comment it all out. Not hard to fix, but can be annoying. I just want ot make sure that if I go with //////// , IDE doesn't see it as some foreign alien gets all screwy when compiling.
The one problem with // is that the end of the line is the end of the comment.
I like to use /* */ comments on one line for something like this:
analogWrite(5, /* sensorValue */ 255);
This way, I can isolate the testing of the LED wiring from the reading of the sensor value, to see which is wrong, without the need to remember what the analogWrite() statement used to look like or copying and pasting the whole line.
Now, this is a trivial example. The places where I actually do something like this are far more complex, but the idea is the same.
If I recall correctly, the \ on the end is a continuation character and means the next line is part of this line. So since this line is a comment, the next line which is actually code, becomes part of the comment and is thus "mysteriously" ignored.
JimboZA:
If I recall correctly, the \ on the end is a continuation character and means the next line is part of this line. So since this line is a comment, the next line which is actually code, becomes part of the comment and is thus "mysteriously" ignored.
CeeDee:
I have been looking at code and see two ways to comment out notes. Does it matter which one is used? Is one better than the other in "this" example?
Examples:
/||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| L I G H T S |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||/
////////////////////////////////////// L I G H T S //////////////////////////////////
Some well meaning templates sometime do this number
/**************************************************************************
This is a setup function
**************************************************************************/
Perfectly legal but just gums up the works visually.
I reserve coding like that to make navigation on long and not working code stand up during debugging.
Sometime it makes search less painful too.