Mail Archives: djgpp/2001/09/29/07:34:02
Here is another version of strrev (I called in flipstring) which I wrote
years ago! - I make no claims on it, so feel free to do with it as you
please ;-)
char *flipstring(char *str)
{
int max,hi,lo;
max=strlen(str);
hi=max-1;
lo=0;
while (lo < hi)
{
str[max] = str[lo];
str[lo++] = str[hi];
str[hi--] = str[max];
}
str[max] = 0;
return str;
}
Tim
Tim
"A. Sinan Unur" <asu1 AT cornell DOT edu> wrote in message
news:Xns912AAABE1AF49ASINANUNUR AT 132 DOT 236 DOT 56 DOT 8...
> Radical NetSurfer wrote in
> news:m1g9rtociqgunetpgm7qb5106m3sqvhpor AT 4ax DOT com:
>
> > in my humble opinion, its NONstandard that Libc doesn't already have
> > this. Please name one other C/C++ compiler that also omits it?
>
> AFAIK, it is not in the ISO standard, and that makes it nonstandard.
>
> I also posted an example where your usage example contradicts how the code
> actually works. (The same holds true with bcc if you use the strrev
> function provided with it).
>
> My opinion does not matter that much, however.
>
> Sinan.
> --
> --------------------------------
> A. Sinan Unur
> http://www.unur.com/
- Raw text -