No, what he is trying to do is create a variable size structure, which
is not possible. I replied to the same question a few weeks ago.
http://news.palmos.com/read/messages?id=192885#192885

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:bounce-449757-
> [EMAIL PROTECTED] On Behalf Of Jagat Mahapatra
> Sent: Friday, July 22, 2005 2:41 AM
> To: Palm Developer Forum
> Subject: RE: Stack Error
> 
> Probably this is not the way to do. Try "#define nCat 5" in the first
> line
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Ricardo
> Sent: Friday, July 22, 2005 11:54 AM
> To: Palm Developer Forum
> Subject: Stack Error
> 
> I'm defining an struct, but I can't create an instance of it.
> I get an error that I just wrote to an unused portion of the stack.
> Any ideas why this happens?
> 
> int nCat = 5;
> int nplats[nCat];
> int totalPlatos;
> 
> for( int i = 0 ; i < nCat ; i++ ){
>   nplats[i] = 5;
>   totalPlatos += nplats[i];
> }
> 
> typedef struct structRecordMenu
> {
>   int  nPlatosTotal;
>   int  nCategorias;
>   char NombreCategoria[nCat][15];
>   int  nPlatos[nCat];
>   char Platos[totalPlatos][15];
>   int  Precios[totalPlatos];
> } RecordMenu;
> 
> RecordMenu a; -> The error happens right here.
> --
> For information on using the PalmSource Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/support/forums/
> 
> 
> 
> --
> For information on using the PalmSource Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/support/forums/



-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to