How C++ Differs from C
Prerequisites: Your first C++ program
A quick map of what's different before going further, assuming you've already worked through Learn C:
std::cout/std::cinreplaceprintf/scanf(thoughprintfstill works — C++ remains almost entirely backward compatible).std::stringreplaces manually-managedchararrays for text.boolis a real, built-in type (not a<stdbool.h>add-on).new/deletereplacemalloc/freefor single objects (and are themselves mostly replaced by smart pointers, in Level 2).- References (
int &r = x;) offer an alternative to pointers for many cases, covered next. - Classes add data and behavior together, instead of a
structplus separate free functions.
C++ is not a strict superset of C — a few valid C programs aren't valid C++ — but the overlap is large enough that C knowledge transfers almost entirely.