I am getting an error when I do directly StrCopy(array, debug)
that is why I changed to the other way. However, you are right I
should be doing this, the problem is that I cannot intialize an static
Array of structs in the same way as using MemPtrNew, maybe you can but
I am not sure because it is not working and it acts weird when I debug
seeing values that does not correspond. Any hint on how to allocate
memories for arrays of structs?

thanks

Luis

On 4/23/06, hv reddy <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I hope u may have to use like following.
> StrCpy(AArray[i].Name , debug);
>
> Also u have to allocate memory for struct AStruct  AArray[5]   using
> MemPtrNew  befor that.
>
> Cheers,
> Harsha
>
> L <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am having problem trying to initialize and assign an array of structs.
>
> struct AStruct {
> Char *Name
> ...
> }
>
> static struct AStruct AArray[5] = { {0} };
>
> StrCopy(debug,"initialized");
> AArray[i].Name = debug; <-- Name does not get string
> StrCopy(AArray[i].Name, fileName); <--- does not work!
>
> I want to copy the string in debug to the Name part of the array of struct
> but this is not working. I thought I should initialize or allocate memory.
>
> Any suggestions?
>
> Thanks,
>
> Luis
>
> --
> For information on using the PalmSource Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/support/forums/
>
>
>
> ________________________________
> Jiyo cricket on Yahoo! India cricket
> Yahoo! Messenger Mobile Stay in touch with your buddies all the time. -- For
> information on using the PalmSource Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/support/forums/
>
>


--
-------------------------------------------------------

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

Reply via email to