c - Are pointers of the same size? -
possible duplicates:
are there platforms pointers different types have different sizes?
are data pointers of same size in 1 platform?
sizeof(bucket *)
same sizeof(int *)
,right?
btw,is char arr[];
valid in c90?
i believe there no requirement pointers same size. requirement object pointers can stored in void *
, when cast void *
, they'll same, , function pointers, if cast type of function pointer , again, same. (casting function pointers void *
not guaranteed work. sorry if indicated otherwise.)
in practice, think time you'll find pointers of different sizes if care c++'s member-function pointers, or work on more obscure architecture.
in c90, char arr[];
valid way pre-declare global array of to-be-determined length. note char arr[]
incomplete type, have declare before can use sizeof
. it's not valid way in c99, make flexible array members.
Comments
Post a Comment