www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/29/07:34:02

From: "Tim Nicholson" <T DOT J DOT Nicholson AT btinternet DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Please add strrev proposal
Date: Sat, 29 Sep 2001 12:14:46 +0100
Organization: Skyforce avionics Limited
Lines: 52
Message-ID: <9p4ajh$gv$1@plutonium.btinternet.com>
References: <lcq8rtk1nqua2hc6rqfhmqisbd587n8t2n AT 4ax DOT com> <Xns912A8823C1399ASINANUNUR AT 132 DOT 236 DOT 56 DOT 8> <m1g9rtociqgunetpgm7qb5106m3sqvhpor AT 4ax DOT com> <Xns912AAABE1AF49ASINANUNUR AT 132 DOT 236 DOT 56 DOT 8>
NNTP-Posting-Host: 213.123.18.202
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019