Richard Heathfield wrote:
>
> Nicolas wrote:
>
> >>
> >> strcat(path, strcpy(file, "fred.txt"));
> >
> > Lol, of course this is obvious.
> > That's because I never (well almost) enclose a call in another call.
>
> It's probably wise to never (well almost) enclose a call in another call.
> Many functions return error indicators which can be missed by such an
> approach.
>
But surely many (most?) are expressions with value. I would use the
trick above without batting an eye. I some string manipulation stuff I
wrote..
char *ltrim(char *s); /* remove leading whitespace, return s */
char *rtrim(char *s); /* remove trailing whitespace, return s */
char *alltrim(char *s) {
return ltrim(rtrim(s));
}
--
Joe Wright
http://www.jw-wright.com
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---