← C++ Programming learning pathC++ Programming · Module 2 of 10
Variables, types and I/O
Store data and read input.
📖 Key ideas
- Types: int, long long, double, char, bool, std::string.
- Read input: std::cin >> x;
- auto lets the compiler deduce types.
- const makes values unchangeable.
- Type casts: static_cast<double>(x).
💡 Real-life example: Types are labelled containers: an int box holds whole numbers, a string box holds text.
intInteger type
std::cinStandard input stream
autoType deduction
static_castExplicit type conversion