From the course: Debugging in C++ with Visual Studio Code
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Syntax errors - Visual Studio Code Tutorial
From the course: Debugging in C++ with Visual Studio Code
Syntax errors
- [Instructor] Now I want to show you a few of the most common compiler errors. This program is a bill split calculator to be used at a restaurant where you go with a group of friends and you want to split the bill equally. The logic of the program is okay, but no measures were taken to prevent or handle runtime errors. The purpose of this exercise is simply to expose lots of compiler errors. That's why I took a simple working version of the program and inserted lots of common compiler errors. And you'll see that all of them have a preceding comment indicating the type of error. We have syntax, semantic, and linker errors. You may want to pause the video to take a close look at the code, but let me briefly show you what it's doing. The main function starts by requesting the total bill amount, the number of people, and the tip percentage. In line 57, it checks if there are more than two people to suggest asking for a group discount. Then, starting at line 62, the split is calculated by…