Thread: Reversing words

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    Hi,

    Look for a space or a '\0'(which is at the end of the string) in your char array. If you find a space or a '\0', record the index position. Then reverse the characters between that index position and the previously recorded index position.
    Last edited by 7stud; 12-01-2005 at 02:31 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reversing Letters in Words of a Sentence
    By CRSpeedy in forum C Programming
    Replies: 10
    Last Post: 03-31-2009, 06:12 PM
  2. Reversing words...noob
    By shardin in forum C Programming
    Replies: 5
    Last Post: 08-23-2007, 11:11 AM
  3. Problem with malloc() and sorting words from text file
    By goron350 in forum C Programming
    Replies: 11
    Last Post: 11-30-2004, 10:01 AM
  4. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 08:00 PM