From the course: Complete Guide to C Programming Foundations
Unlock the full course today
Join today to access over 24,300 courses taught by industry experts.
Adding comments - C Tutorial
From the course: Complete Guide to C Programming Foundations
Adding comments
- [Instructor] Comments are used for a variety of purposes. They can provide information, documentation, and are used in debugging. In the big picture, a comment is a part of your source code that the compiler ignores. It skips over all the commented text. The C language uses two styles of comment. The traditional C language comment starts with the /* characters, and ends with the */ character. All text between these character pairs is ignored by the compiler. The C++ style comment starts with //. All text after the two slashes is ignored until the end of the line. This code shows both style of comments. Lines 1 through 3 are a comment block using the traditional C language start and stop comment characters. Line 4 contains a C++ style comment at the end of the line. Line 9 has a comment at the end of the line as well, but it's enclosed in traditional C style comment characters. One of the purposes of comments is to document your code. The idea is to explain what you're doing to a…
Contents
-
-
-
Coding your first program3m 40s
-
(Locked)
Challenge: Write your own code51s
-
(Locked)
Solution: Write your own code1m 50s
-
(Locked)
Getting into the C language2m 34s
-
(Locked)
Reviewing code structure3m 52s
-
(Locked)
Working the C development cycle3m 45s
-
(Locked)
Challenge: Find and fix the bugs43s
-
(Locked)
Solution: Find and fix the bugs1m 28s
-
(Locked)
Exploring the preprocessor3m 23s
-
(Locked)
Understanding header files and libraries3m 19s
-
(Locked)
Adding comments2m 49s
-
(Locked)
Chapter challenge: Building the foundation1m 11s
-
(Locked)
Chapter solution: Building the foundation1m 38s
-
-
-
-
-
-
-
-
-
-
-