You are almost right ;-). On "typical" implementations, pointers to data types have the same size; alas, there is no guarantee. Originally, in early C, pointers were indeed basically treated as integers. It is with larger programs that the need evolved to have a stricter type system (for example, C++'s is stricter than C's) so that the programmer's intentions are documented immediately in code, and the compiler has a chance to verify that the program realizes the intentions and not something else.
↧