c++ - Where is pointer metadata stored? -
Maybe I'm looking somewhat, but where is the indicator metadata stored? For example if I have 32-bit int pointer ptr
and I execute ptr ++
, then it knows to advance 4 bytes in memory. However, if I have 64-bit int pointer, then it knows to advance 8 byte. So what type of pointer is ptr
and where is it stored? You can limit it to C ++ for simplicity.
It is not stored anywhere, per-to-compiler sees the type of PTR and + operation Converts the growth of the correct number of bytes to increments.
Comments
Post a Comment