> Hi all
>
> I created a data structure such as:
>
> typedef struct
> {
> const char *company;
> const char *category;
> } DS;
>
> and then set the default memory block such as:
>
> static DS DefaultDS =
> {
> "Starbucks",
> "Coffee"
> };
>
> Does this actually put "starbucks","coffee" into the DS struct(1st record)
> so that when I 'DmQueryRecord' the 1st record it should return these 2
> fields? It does not seem to work, what exactly does the "static DS
DefaultDS
> = " part do if not what I thought it does?
I can see exactly where you are coming from. Someone told you (quite
correctly)
that the character strings in your struct should be allocated statically.
Well this is how you do it:
typedef struct{
char company[20];
char category[20];
}DS;
or words to that effect.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/