#063 – Memory-efficient string retrival via c_str()

C++ programmers spend most of their time inside std::string, but the world outside — operating system APIs, the C standard library, third-party SDKs written in C — still speaks in null-terminated character arrays. The bridge between the two is c_str(), and the…

#060 – The Non-Virtual Interface Idiom (NVI)

The first time most programmers meet virtual, they reach for it the obvious way: any function a derived class might want to override gets marked virtual in the public interface. It works, the hierarchy compiles, and polymorphism does what it advertises. The trouble…

#059 – Type aliases are immensely beneficial

We’re all familiar with this statement which uses a using directive: using namespace std; That tells the compiler to make names from the std namespace available without writing the std:: prefix. However, using can also be used to create a type alias. This creates a custom-defined type…