Sunday, June 20, 2010

Arduino learning-1

; semicolon
A semicolon must be used to end a statement and separate elements of the program. A semicolon is also used to separate elements in a for loop.
int x = 13; // declares variable 'x' as the integer 13
Note: Forgetting to end a line in a semicolon will result in a compiler error. The error text may be obvious, and refer to a missing semicolon, or it may not. If an impenetrable or seemingly illogical compiler error comes up, one of the first things to check is a missing semicolon, near the line where the compiler complained.
/*… */ block comments
Block comments, or multi-line comments, are areas of text ignored by the program and are used for large text descriptions of code or comments that help others understand parts of the program. They begin with /* and end with */ and can span multiple lines.
/* this is an enclosed block comment
don’t forget the closing comment -
they have to be balanced!
*/
Because comments are ignored by the program and take no memory space they should be used generously and can also be used to “comment out” blocks of code for debugging purposes.
Note: While it is possible to enclose single line comments within a block comment, enclosing a second block comment is not allowed.
// line comments
Single line comments begin with // and end with the next line of code. Like block comments, they are ignored by the program and take no memory space.
// this is a single line comment
Single line comments are often used after a valid statement to provide more information about what the statement accomplishes or to provide a future reminder.
Related Posts Plugin for WordPress, Blogger...
Disclaimer: All the information in this blog is just gathered from different sites in the web and placed here and I am not the owner for these content

Popular Projects

Followers

My Blog List

Give Support

Give Support
Encourage me Through Comments & by Following