Another problem with your code: char s[1] only allocates 1 byte for s. To
store "ab" you need three bytes for 'a', 'b', and '\0'.
----- Original Message -----
From: "Dave Lippincott" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, July 07, 2000 5:07 PM
Subject: Re: StrCat
> text1 and text2 are set to the same address. 'b' is overwritting 'a'
>
> try
> StrCat(TextIn,"ab");
>
> or
> s[0] = 'a';
> s[1] = 'b';
> s[2] = NULL;
> StrCat(TextIn,s);
> TextOut = TextIn; // if you must or just use return (StrCat(TextIn,s));
>
> ----- Original Message -----
> From: "Farzin Ashraghi" <[EMAIL PROTECTED]>
> To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> Sent: Friday, July 07, 2000 6:10 PM
> Subject: StrCat
>
>
> > Hi!
> >
> > I'm having problems using StrCat. I want to obtain texOut = "ab".
> > Could you tell me please, what is wrong with this?
> >
> > char s[1];
> > CharPtr textOut, text1=s, text2=s;
> > text1="a";
> > text2="b";
> > textOut=StrCat(textIn, textTemp);
> >
> > Thank you!
> > Farzin
> >
> > --
> > 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/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/