Section 2. Fundamentals. 2.1 C# Comments
Comments can be used to explain C# code, and to make it more readable. It can also be used to prevent execution when testing alternative code.
Single-line comments start with two forward slashes (//). Any text between // and the end of the line is ignored by C# (will not be executed). The example below uses a single-line comment before a line of code and a single-line comment at the end of a line of code.
C# Multi-line Comments
Multi-line comments start with /* and ends with */. Any text between /* and */ will be ignored by C#.
The example below uses a multi-line comment (a comment block) to explain the code.
It is up to you which comments do you want to use. We use // for short comments, and /* */ for longer comments.
Thank you for reading.
Check for more tutorials at acoptex.lt.
Check for Arduino and Raspberry Pi projects on our website acoptex.com.