NEW! Explore Our New Platform, the Playback Press
Learn from all of your favorite code playbacks (including the ones in this book) on our brand-new site, the Playback Press.
At the Playback Press, every playback is equipped with an AI assistant that's ready to answer your questions and to test your knowledge of the material you are learning. Watch this video, "How to View a Code Playback", to see these exciting new features in action. It's like having a personal tutor right at your fingertips!
All of our books remain free of charge, check them out now!
Welcome! This book is an introduction to programming using C++. I assume the reader has no previous programming experience. My goal is to focus on worked coding examples to explain how to program. Most of what I write will be in the context of a code example. The code will always be the priority but I have also added text, pictures, screenshots, and videos that refer to the code.
The tool that I am using to show these examples is called Storyteller. It animates the construction of some code that a software developer has written. I will use it to show how a program grows from an empty file to a functioning program. I will explain the basics of C++ programming by telling the story of how programs grow. For each of the 'playbacks' below simply click on the comments on the left hand side of the screen to move through the code.
If you'd like to stay connected and get updates when I add new playbacks you can follow me on twitter: @markm208.
1.1 Name printer program |
1.2 Distance formula |
1.3 Basic types in C++ |
1.4 Number types |
1.5 Characters and strings |
1.6 Weekly pay calculator |
1.7 Distance formula revisited |
1.8 Gas Mileage |
2.1 Booleans |
2.2 Even/odd calculator |
2.3 Overtime pay with an if/else |
2.4 Water temperature |
2.5 Switch |
3.1 A simple loop |
3.2 More loops |
3.3 Summation |
3.4 Nested loop |
3.5 for loop |
3.6 Capitalization |
3.7 break and continue |
4.1 Arrays |
4.2 Average and standard deviation of an array of values |
4.3 Problems with arrays |
4.4 Flipping coins |
4.5 Multi-dimensional arrays |
5.1 Functions |
5.2 Value returning functions |
5.3 Functions with parameters |
5.4 Passing parameters by reference |
5.5 The scope of variables |
5.6 Prime number function |
5.7 Passing arrays to functions |
7.1 Simple struct |
7.2 Hierarchical structs |
7.3 Vectors as members of structs |
7.4 structs with a vector of objects |
7.5 Calculus with structs |
Chapter 8 Pointers and Dynamic Memory
10.1 Simple linked list |
10.2 Simple hash table |
10.3 More complex hash table |
10.4 STL unordered_map |
10.5 Binary search stree |
10.6 Graph adjacency matrix |