Re: sizeof(ptr) = ?
William Xu wrote:
> I test it with char, short, int, long, float, double and struct
> pointers, all return 4 bytes. Does the standard say anything about
> sizeof a pointer? (I didn't find it in the standard...)
No. It says that a pointer of type void * must be capable of holding any
pointer value, but nothing specific is said about the sizes of
pointers. Pointers to different types could be of the same or different
sizes.
|