c++ - Can pointers be of different sizes? -


this question has answer here:

this answer comes interesting statement - "on machines int* smaller char*". (let's exclude pointers functions)

is possible pointers different types have different sizes? why useful?

yes, it's entirely possible. on machines, pointer byte contains 2 values: pointer word address of memory word containing byte, , "byte index" gives position of byte within word. e.g. on 32-bit machine, "byte index" 0..3.

this require more storage space "int *", pointer relevant word.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -