marp | theme | footer |
---|---|---|
true |
custom-theme |
STL stands for Standard Template Library We're gonna talk about it a lot!
📺 Watch the related YouTube video!
- Working with terminal
- Hello world dissection
- Variables of fundamental types
- This lecture is beginner friendly
- There are some best practices that would use different types, but those require more in-depth understanding and will be covered later
- What you see on this slide is the best practice until this point in the course 😉
- 🎨 - Style recommendation
- 🎓 - Software design recommendation
- 😱 - Not a good practice! Avoid in real life!
- ✅ - Good practice!
- ❌ - Whatever is marked with this is wrong
- 🚨 - Alert! Important information!
- 💡 - Hint or a useful exercise
- 🔼1️⃣7️⃣ - Holds for this version of C++(here, 17) and above
- 🔽1️⃣1️⃣ - Holds for versions until this one C++(here, 11)
Style (🎨) and software design (🎓) recommendations mostly come from Google Style Sheet and the CppCoreGuidelines
- Handle
stdin
,stdout
andstderr
:std::cin
--- maps tostdin
std::cout
--- maps tostdout
std::cerr
--- maps tostderr
#include <iostream>
to use I/O streams- Easier to use than
std::printf
but slower - 💡 We will cover a better way for logging in the future but streams are totally good enough for now 👌
#include <iostream>
int main() {
int some_number{};
std::cin >> some_number;
std::cout << "number = " << some_number << std::endl;
std::cerr << "boring error message" << std::endl;
return 0;
}