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.
Solution: Find and fix the bugs - C Tutorial
From the course: C Essential Training
Solution: Find and fix the bugs
(lively music) - [Instructor] I'm going to work through this challenge to show you how I arrived at the solution. Behold the code with two bugs. To find the first, I'm just going to build, not build and run, just build. And the bugs appear, shown here in the Build messages tab. The second one is really just a warning, but the first bug causes the second to be interpreted improperly. First things first. The missing terminator character at line 7. A string literal needs a second double quote, and this is where color-coding the text plays a good role in helping you write code. Add the double quote. See how the colors change? Save, and build again. And now we're down to one error. The second error presents itself properly, displaying line 13 is missing a semicolon, which might be before or after line 13. The compiler isn't really accurate. But here it is. Add the semicolon right there at the end of the break…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Coding your first program3m 18s
-
(Locked)
Challenge: Write your own code1m 5s
-
(Locked)
Solution: Write your own code1m 34s
-
(Locked)
Getting into the C language2m 29s
-
(Locked)
Reviewing code structure2m 56s
-
(Locked)
Working the C development cycle3m 11s
-
(Locked)
Challenge: Find and fix the bugs45s
-
(Locked)
Solution: Find and fix the bugs1m 38s
-
(Locked)
Exploring the preprocessor3m 25s
-
(Locked)
Understanding header files and libraries3m 19s
-
(Locked)
Adding comments2m 39s
-
(Locked)
Challenge: Build the foundation1m 13s
-
(Locked)
Solution: Build the foundation1m 30s
-
-
-
-
-
-