|
|
|
|
|
by csboyer
2115 days ago
|
|
The pointer variable does not contain the type - it only stores the address. Sizeof will return whatever the machine address width is. The type is implicitly stored as the pointers type. Casting a pointer can change a piece of memory to be interpreted as any type you want. Although the cast might not make logical sense or may even caused undefined behavior in C. Pointer arithmetic works off of whatever the current type is, as the compiler needs to know how to the memory offsets. |
|