Explain the different storage classes in C++ (auto, register, static, extern) and where they are stored in the memory map.
Last updated
Storage classes set lifetime and linkage:
automeant stack locals (now repurposed for type deduction), andregisterwas a CPU-register hint (now deprecated/removed).staticgives whole-program lifetime in the data/BSS segment, internal linkage at file scope, and value persistence for locals.externdeclares an externally linked object defined in another translation unit, stored in that unit's data segment.