Hi,
Please do yourself a favour and get yourself a beginners C language book. I
know that the concept of pointers is hard to grasp at first but is one of
the most important parts of C/C++.

/Tommy

"Low Pui Kuen" <[EMAIL PROTECTED]> wrote in message
news:76385@palm-dev-forum...
>
> Hi everyone,
>
> I have a problem of reading out the members of the STUDENT structure.
> All the members are char pointers. When I try to read out the member
(Name),
> I got memory access error.
> Can anyone tell me what have I missed out? Or what is the way to access
the
> members(seems like ptr->Name doesn't work; the Name is char pointer)
Thanks
> in advance.
>
>
> typedef struct Student
> {
>
>    Char *StudentID;
>    Char *Name;
>    Char *Sex;
>    Char *Age;
>    Char *Email;
>    Char *Phone_HP;
>    Char *Phone_H;
>
> }STUDENT;
>
>
> void ReadStudRecord(Char *DatabaseName, int index )
> {
> STUDENT *ptr, S;
> MemHandle h;
>
> dbPtr = OpenDB(dbPtr,DatabaseName);
>
> if(!dbPtr)
> PrintString("dbPtr returned by the OpenDB in the ReadRecord(STUDENT) is
> NUll");
> else
> {
>     h = DmQueryRecord(dbPtr,index);
> if(!h)
> //return DmGetLastErr();
> PrintString("DmQueryRecord in ReadRecord() FAILED <NPET-Database.c>");
>
>
> else
> {
>     ptr = (STUDENT *) MemHandleLock(h);
>
> PrintString(ptr->Name);  //==================>
>                                     ^^^^^^^^^
>                                        //I think the error is caused by
> //here
>
>
> MemHandleUnlock(h);
>
>
> }
> }
>
>
> }
>
> Low Pui Kuen
>
> _________________________________________________________________
> Join the world's largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
>
>



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

Reply via email to