From the course: C Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Adding comments

Adding comments - C Tutorial

From the course: C Essential Training

Start my 1-month free trial

Adding comments

- [Instructor] Comments are used for a variety of purposes but in the big picture, a comment is part of your source code that the compiler ignores. It skips over all commented text. The C language uses two styles of comments. The traditional C language comment starts with the slash asterisk character pair. All text that follows is ignored by the compiler until the asterisk slash characters are encountered. You can comment a block of text as shown here between lines one and five or you could comment a single line as shown at line eight. You can even add comments after a statement, which appears here at line 11. The C compiler also understands C++ style comments. This comment starts with two forward slashes and then the comment extends for the rest of the line. This format is for a single line comment only. The purpose for comments is to document your code. The idea is to explain what you're doing to a future version of…

Contents