////////////////////////////header.h
typedef struct {
char *name;
char *id;
} StudentRecordType;extern StudentRecordType std; //declare std as a global variable
////////////////////////////form1.c
StudentRecordType std; //define std
void fun1(void)
{
char *name = GetFieldText(Form1NameField); //this function can return the user input value
std.name = name;
FrmGotoForm(Form2Form); //go to form 2 }
////////////////////////////form2.c
void fun2(void)
{
char *id = GetFieldText(Form1IDField); //this function can return the user input value
std.id = id;
//when debugging, I found, name pointer points to anywhere, not the original value.
//write std to DB here
}
how to solve it? Please help.
_________________________________________________________________
No masks required! Use MSN Messenger to chat with friends and family. http://go.msnserver.com/HK/25382.asp
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
