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

Solution: Find and fix the bugs - C Tutorial

From the course: C Essential Training

Start my 1-month free trial

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…

Contents