> > Hi All, I'm having a small problem here, hope somebody can tell me
what's
> > wrong. I have a database that contains several records, which all share
> > the same struct.
> >
> > typedef struct {
> > Int32 ID;
> > const char *Class;
> > const char *Name;
> > const char Gender;
> > } StudentRecord;
<snip>
i dont know when palm-dev-forum became a learning-c discussion list :)
but, look at your structure again. what does it contain?
- and id
- a pointer to a bit of memory (where the class is stored)
- a pointer to a bit of memory (where the name is stored)
- a character to represent the gender
now.. look back at these.. can you see what is wrong? :) your never
actually storing the class or name in your struct. when you write it,
it'll put the values of the pointers. when you read, those values
that are put in are 100% not likely to be valid :)
easy bug fix.
--
Aaron Ardiri
CEO - CTO
Mobile Wizardry
http://www.mobilewizardry.com/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/