From the course: Complete Guide to C Programming Foundations

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Solution: Find and fix the bugs

Solution: Find and fix the bugs - C Tutorial

From the course: Complete Guide to C Programming Foundations

Solution: Find and fix the bugs

- [Instructor] I am going to work through this challenge to show you how I arrived at the solution. First, if the editor is color coded as most are, and this one is here, you see what I call string bleed. This string starts here, but it's unterminated. The color coding in the editor assumes that all of this text is part of the string. So the first thing you can fix is to add the double quote right here at the end of the Print F statement before the parentheses. See how the colors change. Now, to find the second bug, I can go ahead and run the code and the compiler should tell me where it is. And there you go. Expected a semicolon before the brace and it says line 13. Let's go look at line 13. Yeah, you can see the squiggly underline. Here's the second bug it's a missing semicolon. This is very common lots of C programmers forget semicolons, even me. Add the semicolon and try to run again. Have the compiler help you here. Oh, well, it looks like something's working, there you go…

Contents