A question about sizeof

Erkki Ruohtula eru at tnvsu1.tele.nokia.fi
Mon Oct 22 18:32:49 AEST 1990


The standard says that "sizeof something_of_array_type" gives the size of the
array, not that of the pointer to the first element. But when does the
"arrayness" disappear in the conversion to pointer? What should
"sizeof (struct_pointer->field_of_array_type)" be? Do the parentheses affect
the interpretation?

There is a compiler that gives the pointer size in the last example, and I am
wondering, whether or not this is a bug.
--
Erkki Ruohtula     / Nokia Telecommunications
eru at tele.nokia.fi / P.O. Box 33 SF-02601 Espoo, Finland
Disclaimer: These are my private opinions and do not represent the position
            of Nokia Telecommunications.



More information about the Comp.std.c mailing list