>     StrCopy(myform->formName, buffer);
where's the memory for formName ??

myform->formName = (Char*)MemPtrNew(MAX_SIZE * sizeof(Char));
StrCopy(............

Frankly, even the statements before the StrCopy could land you in trouble,
since you're assigning a constant string to a ptr that isn't constant...


Please go through a good book on C programming first.

-vc



----- Original Message -----
From: "J�lio F�bio de O. Chagas" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Wednesday, November 21, 2001 4:36 PM
Subject: trouble with struct


> What is wrong with the code bellow ?
>
> ---definitios.h------- X ----------------------------
> typedef struct {
> Char * formName;
> } myFormStruct;
>
> typedef myFormStruct *myFormStructPtr;
> ---main.c------------- X ----------------------------
> void myFunction()
> {
>     myFormStructPtr myform;
>     Char *buffer;
>
>     myform = (myFormStructPtr) MemPtrNew(sizeof(myFormStruct ));
>     buffer = "FormNumberOne";
>     StrCopy(myform->formName, buffer);
>     ...
>     ...
> }
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>
>


--
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