> typedef struct structRecordMenu
> {
>   int  nTotal;
>   int  nCat;
>   char (NameCat[nCat])[20];
>   int  nPlats[nCat];
>   char (NamPlat[nTotal])[20];
>   int  Prices[nTotal];
> } RecordM;

You cannot define a structure like this with variable size arrays. A
structure must have a defined size. To accomplish what you are trying,
perhaps you could do the following:

typedef struct structRecordMenu
{
Int16  nTotal;
Int16  nCat;
} RecordM;

Write this structure to the record. Then at offset (sizeof(RecordM))
write the list of names, each string 20 bytes wide. Then at offset
(sizeof(RecordM) + (nCat * 20)) write the nPlats array. Then at offset
(sizeof(RecordM) + (nCat * 20) + (nCat * sizeof(Int16))) write the list
of strings in NamPlat. Then at offset (sizeof(RecordM) + (nCat * 20) +
(nCat * sizeof(Int16)) + (nTotal * 20)) write the array of prices.

Jonathan King



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

Reply via email to