C++ inherits C's numeric types with the same minimum-size guarantees, but adds real improvements: bool has been a genuine built-in type since C++'s earliest days (unlike C, which lacked one until C99), and std::string provides a proper, safe, dynamically-resizing string type — a real class, not just a char array convention. auto, introduced in C++11, tells the compiler to infer a variable's type from its initializer at compile time; the variable's type is fixed at that point exactly as if it had been written explicitly, so auto is purely a convenience for the programmer, never a step toward dynamic typing.
auto: type inference, not dynamic typing
Both declarations end up with the EXACT same type — auto is resolved once, at compile time, from the initializer; count's type can never change afterward, just like an explicitly-typed variable's can't.
int count = 5; // explicit type
auto count2 = 5; // auto — but STILL deduced as int, fixed at compile time
// count2 = "hello"; // COMPILE ERROR — count2 is int, always was, always will bebool: a real type from the start
Unlike C, which had no boolean type at all until C99, C++ has had bool as a genuine built-in type since its earliest versions — no header include ever required.
bool isValid = true;
if (isValid) {
std::cout << "valid\n";
}std::string: a real, safe string type
Unlike C's char arrays, std::string manages its own memory, resizes automatically, and provides safe operations like + for concatenation and .length() for size — no manual null-terminator bookkeeping or buffer-size math required.
#include <string>
std::string name = "Alice";
std::string greeting = "Hello, " + name + "!"; // safe concatenation, no manual buffer sizing
std::cout << greeting.length() << "\n"; // built-in length tracking