Re: Reverse word order to read it from right to left



osmium wrote:
"lovecreatesbea...@xxxxxxxxx" wrote:

I want to write a function to reverse the order of words to make
it read from right to left, but it doesn't work. Can you help me
and point out my mistakes. Thank you for your time.

<snip>

You forgot to explain the theory of operation. Should it work on
n words of just two words? Do the words have to be the same size?
You seem to have a fondness for switch statements that don't seem
necessary. Some compilers may accept the definition you have for
the array, a. They don't have to.

The OP could take a look at freverse.c, a test program for the
ggets general purpose string input routine. See ggets.zip at:

<http://cbfalconer.home.att.net/download/>

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>



--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • Re: David Marks Javascript Tip Du Jour - Volume #1 - Tip #1234 - How to Measure Element
    ... It could not explain how the structure moves from project to project, and without that it could not qualify as cargo cult programming. ... Older versions of browsers would be a better excuse, but not when it is found in code that is only designed to be supported by a known sub-set of 'current' browsers, as is the case with the 'popular' libraries that have featured this code. ... That suggests limiting the scope of your early work, and learning from the mistakes before propagating the code to the rest of the world. ...
    (comp.lang.javascript)
  • Re: So you want APPROACHABLE oo, REAL oo, INTEGER oo, COUNTABLE oo, HIGHER oo, MEGA oos
    ... repeatedly proven that you make all sorts of mistakes. ... Because he is fundamentally correct and his opponents eventually see ... tired of trying to get him to engage in the sane mathematical discourse. ...
    (sci.logic)
  • Re: Gates Wants Higher Educational Standards
    ... KP's mistakes, misrepresentations, and overly active imaginations. ... Often those were caused by slight incompatibilities between the actual code and whether or not the compiler was still supporting it. ... Yeah, we did punch cards, too. ...
    (sci.research.careers)
  • Re: Someone tell me Millers wrong
    ... somehow Indy and all of American open wheel would ... No more remarkable than the concept that everything is Tony George's ... [SNIP} ... the short-term consequences of his mistakes and poor decisions, ...
    (rec.autos.sport.indy)
  • Re: How does an executable know that it needs a specific *.dll or *.so to be able to run?
    ... osmium wrote: ... that is inspected by the OSS before it is allowed to run? ... snip ... ... Feel free to discuss the issue both under Unix and Windows. ...
    (comp.programming)