but I need something bigger, say char[255] and when I do that the stack
overflows, what should I do?
"Richard Burmeister" <[EMAIL PROTECTED]> wrote in message
news:38183@palm-dev-forum...
>
> > From: Ender Wiggin
>
> > ok, here are the class declarations:
> > class TextFile
> > {
> > public:
> > char* Body;
> > int Num;
> > LocationType Destinations[20];
> > };
> > class LocationType
> > {
> > public:
> > char* Name;
> > };
> >
> > > >well, I said this:
> > > > TextFile File; //This is not a file stream but a regular struct
> > > > StrCopy(File.Destinations[0].Name,"Forest");
>
> In the above, File.Destinations[0].Name is a pointer to char. It is not
an
> array that you can fill up with chars. Essentially, you are doing this:
>
> Char *pChar;
> StrCopy(pChar, "Forest"); // error!
>
> This is very bad because there is no memory allocated for StrCopy to copy
> the characters to.
>
> You could do something like this:
>
> Char pChar[7];
> StrCopy(pChar, "Forest");
>
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/