Tag: C++
All the articles with the tag "C++".
-
static_cast vs dynamic_cast in C++: Which One to Use
static_cast is checked at compile time and costs nothing. dynamic_cast checks the real type at runtime and fails safely. When to use each.
-
How to Get the Size of a Vector in C++
Use v.size() to get the number of elements in a C++ vector. Covers size vs capacity, the unsigned size_t trap, empty(), and 2D vectors.
-
How to Append to a File in C++ (std::ios::app)
Updated:Append text to an existing file in C++ with ofstream and std::ios::app. Learn app vs ate vs trunc, how to avoid overwriting your file, and how to log safely.
-
Maximum Value of a double in C++ (DBL_MAX Explained)
The max value of a double in C++ is about 1.8e308. Get it with DBL_MAX or numeric_limits, and learn why min() is not the most negative value.