Re: Computer programmers' habits in electronics



On Thu, 22 Dec 2005 00:56:34 +0000, Rich Grise, but drunk wrote:

> On Wed, 21 Dec 2005 21:02:51 +0000, Ignoramus32515 wrote:
>
>> that's what we want, reverse in place.
>
> 'Kay.
>
for (i = strlen(string) - 1, j = 0; i > j; i--, j++) {
> c = string[i];
> d = string[j];
> string[i] = d;
> string[j] = c;

It could probably be done a little less verbosely by writing a
simple swap(char1, char2) thing, but, well, that's really just
a matter of taking the above and putting it an a swap() routine.

Remember, I wanna telecommute, unless somebody wants to relocate
me. :-)

Cheers!
Rich

.



Relevant Pages

  • Re: left handed writing
    ... write all letters though sometimes she flips a few. ... Anyways, the thing is, she writes 50% of the time in reverse. ... I think since she just started writing she'll figure ... It's very common among left handed kids, ...
    (misc.kids)
  • Re: left handed writing
    ... Anyways, the thing is, she writes 50% of the time in reverse. ... I think since she just started writing she'll ... If she happened to start nearer to the left edge of the paper she ... edge, she would write backwards. ...
    (misc.kids)
  • Re: left handed writing
    ... Anyways, the thing is, she writes 50% of the time in reverse. ... at the far right and writes in the correct order, ... I think the fact that she's lefthanded plays ... I think since she just started writing she'll figure ...
    (misc.kids)
  • Re: abt pointers in c
    ... one of my friend attended an interview and she got a qtn of writing a ... pgm to reverse a string. ...
    (comp.lang.c)
  • Re: BBC news article: Caffeine makes diabetes worse
    ... >> the reverse. ... >GRRRRRRRRROOOOOOOOOOOOOOOOOAAAAAAAAAAAAAAAAAAAANNNNNNNNNNNNNN. ... >Writing is not necessarily something to be ashamed of, ...
    (alt.support.diabetes)

Quantcast