Troy demonstrates what Cppcheck found on the example code in this video.
(tinkling and swooshing)…- [Instructor] Did you find the issues in the challenge?…Hopefully, you found them all.…Let me show you what I found.…In fact, let's go to the code,…and let's go ahead and do a right click,…open it in the terminal,…and we're going to do a cppcheck…- -enable…=all…and ./*.cpp,…and what we find is it says that it found four errors.…
Array houseCats accessed at index 2,…so this is on line 17,…so right here.…I'm actually creating two of these items,…so there going to be index of zero and one, not two,…It's correctly found that.…And line 22, there's a bunch going on…with this trying to create a file.…It's saying that the buffer accessed is out of bounds,…a memory leak on buffer,…and this is actually very serious,…because memory leaks are one of those things…that it doesn't kill you at first,…but it kills your application eventually…and at a random spot,…and then it's also another resource leak,…because we're not getting rid of the file handle…that we've grabbed here.…
And then, on line 40,…it is saying that iterator iter…
- Major new C++ features
- Turning on modern C++
- Letting the compiler help
- Using the new features correctly
- Using auto type deduction
- Using lambdas
- Range-based for loops
- How C++ and the Standard Template Library name things
- Making the best of the filesystem library
- Managing objects
Skill Level Beginner
1. What Is Modern C++?
2. Tools That Improve Your Code
3. Using the New Features Correctly
4. Don't Reinvent the Wheel
5. Managing Objects
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.