C++ for C Developers
You already know most of C++. The syntax is nearly identical — what changes is the idioms. This path covers exactly the delta: what to drop, what to upgrade, and what stays the same.
The good news
C++ is a strict superset of most C. Your existing C code compiles as C++ with little or no modification. The transition is about learning C++ idioms — not relearning programming. A strong C developer can be productive in C++ within a week, and expert within a few months.
The key mindset shifts
| In C you write | In C++ you write | Why |
|---|---|---|
| malloc/free | unique_ptr / make_unique | Automatic lifetime management eliminates most memory bugs |
| #define MAX 100 | constexpr int MAX = 100; | Type-safe, scoped, debuggable |
| void* for generics | Templates | Type-safe generics with zero overhead |
| printf("%d", n) | std::cout << n or std::print("{}", n) | Type-safe I/O, no format string bugs |
| struct + function ptrs | Classes with virtual functions | Encapsulation + polymorphism built in |
| errno for errors | Exceptions or std::expected | Cannot be silently ignored; structured propagation |
| Manual string + strlen | std::string / std::string_view | No buffer overflows, RAII lifetime |
| qsort with void* | std::sort with lambda | Inlineable, type-safe, 2-3× faster |
Topics
Namespaces replace prefixes
gl_DrawArrays, SDL_Init, FMOD_... → DrawArrays (inside namespace gl), Init (namespace SDL). Cleaner, same binary output.
The C++ standard library vs libc
When to use std::sort vs qsort, std::string vs char*, std::fstream vs FILE*. The C standard library still works — C++ just has better options.