-2

I have a question that I don't figure out about object. does making a object in c++ create a piece memory where all the data are stored inside that memory?

Wildzaka02
  • 29
  • 4

1 Answers1

0

Proper term is "memory location". An object may have memory location that can be described by an element of single primitive type or a sequence of elements. An object have "storage". Neither term refers to any particular representation in physical memory, it can be an abstraction, a range of RAM or cache storage units or a CPU register. A statically defined constexpr object might not have a memory location at all, but will have storage. Difference between storage and memory location is that latter can be adressed by other, external in relation to this object, means, e.g. by dereferencing pointer, by passing a reference to a function, by pointer arythmetics within range of an array of objects, etc.

Swift - Friday Pie
  • 12,777
  • 2
  • 19
  • 42