[csw-maintainers] need help with C++ cmopile problem

Ben Walton bwalton at opencsw.org
Sun Jun 13 14:34:07 CEST 2010


Excerpts from James Lee's message of Sun Jun 13 04:39:30 -0400 2010:

Hi James,

> typedef struct fooo{
> int filler;
> int *testing;
> } foostruct;

This was my first thought too, but I hesitated to send it as I wasn't
sure about it[1].  The C compiler would most likely turn 'int
testing[]' into 'int *testing' I think since defining a struct of
unknown (variable) size wouldn't be useful.  But, 'int *' can be
different than 'int []' as the array wouldn't require a de-reference
to access to the contents.  Will Phil need to look at how the
structure is used to ensure it's treated as 'int *' even though
originally declared as 'int []' ?

Thanks
-Ben

[1] I don't write enough C (and no C++) code to be confident about it.
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302



More information about the maintainers mailing list