My string (long_str) is delimited by "~". I need to
chop off by ~ point and output multiple short_str to
the screen:
I am looping the long_str and look for "~":
for (i = 0; i < StrLen(long_str); i++) {
if (long_str[i] != '~')
/* not a ~, so i am building new short_str */
/* by cancatenating the new char to the end */
/* this is NOT working */
StrCat(short_str, &P[i])
else
/* if it is a ~, i output the short_str */
WinDrawChars(short_str, StrLen(short_str)...);
/* reinitialize short_str for next time*/
str[0] = '\0';
}
BTW, I tried (void)StrNCat(str, &P[i], 1) and it
didn't work for me.
--- Alan Perry <[EMAIL PROTECTED]> wrote:
>
> Exactly what do you want to do?
>
> StrCat wants two strings, a sequence of 0 or more
> characters terminated
> by a NULL. This sequence of characters is referred
> to by a pointer to
> the first character in the sequence.
>
> P[i] is a single character and &P[i] is effectively
> a reference to the
> string starting i characters into the array P,
> right?
>
> I think using "(void)StrNCat(str, &P[i], 1)" instead
> of StrCat will
> accomplish the immediate goal of what you want to
> do, but you might want
> to think about your approach to the bigger problem.
>
> alan
>
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/