Functions Part II
Today we started by talking about the Times Tables assignment and an extra credit opportunity for more practice with loops. In general, if you're going to be iterating over a 2D region, a doubly-nested for loop is the most natural way to do it. If you're doing something like adding up everything in a 3D region, then a triply-nested for loop is the most natural way of doing it.
We then talked a lot about functions today, including most importantly that not all of them are like functions in algebra. Some take no parameters, and some return no values. In those cases, they usually have a side effect of some sort (like couting something to the screen, which is very different from returning a value).
We then talked about different ways of working with strings, including using push_back to add a character, += to append another string, .at() to grab or set a character in the string, reverse() to reverse it, to_string() to convert an int to string, stoi() to convert a string to int, and so forth.
Other Videos By Bill Kerney
2021-09-14 | Under the Hood I + Lighting + Special Effects in UE4 |
2021-09-14 | Introducing Readlib |
2021-09-14 | C++ I/O and Digital Logic |
2021-09-13 | Function Overloading and Commenting Code |
2021-09-13 | Truth Tables - AND, OR, NOT |
2021-09-11 | Call by Reference |
2021-09-10 | Modus Ponens and Modus Tollens |
2021-09-10 | SVN, Voronoi |
2021-09-10 | GDC Talks, Landscape III, Material Functions |
2021-09-10 | Combinatorics, Inclusion/Exclusion |
2021-09-08 | Functions Part II |
2021-09-08 | Arguments + Invalid/Valid/Sound |
2021-09-07 | Voroni |
2021-09-07 | CSG, Sprinting, Water (Old and New) |
2021-09-07 | Constexpr, Permutations, Combinations, Binomial Theorem, and Infinite Sets |
2021-09-03 | Functions in C++ Part I |
2021-09-03 | Five Theories of Truth |
2021-09-02 | UE4 Blueprints |
2021-09-02 | Set Theory I |
2021-09-02 | The Laser Zombies |
2021-09-01 | Integer Overflow, String Comparisons, Range-Based For Loops, Nested Loops |