From cppreference.com
Defines the semantics of computer memory storage for the purpose of the C++ abstract machine.
The memory available to a C++ program is one or more contiguous sequences of bytes. Each byte in memory has a unique address.
Byte
A byte is the smallest addressable unit of memory. It is defined as a contiguous sequence of bits, large enough to hold
the value of any UTF-8 code unit (256 distinct values) and of
Similar to C, C++ supports bytes of sizes 8 bits and greater.
The
char, unsignedchar, and signedchar use one byte for both storage and
. The number of bits in a byte is accessible as
or std::numeric_limits<unsignedchar>::digits.
Memory location
A memory location is the storage occupied by the
of either an object of
that is not a
, or the largest contiguous sequence of bit-fields of non-zero length.
Note: Various features of the language, such as
and
, might involve additional memory locations that are not accessible to programs but are managed by the implementation.
structS{chara;// memory location #1intb:5;// memory location #2intc:11,// memory location #2 (continued):0,d:8;// memory location #3struct{intee:8;// memory location #4}e;}obj;// The object “obj” consists of 4 separate memory locationsDefect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior
C++98 objects occupying the same storage were
considered as different memory locations memory location
now refers to storage See also