well one of solution is consider each word as a node. pointing to next node
and then you have a linked list..
And you can easily reverse the linked list..

struct node
{
   char *str;
   node *next;
}*p;
each node contain the word pointing to next node..
hello->world->null
you can now write a code to reverse a linked list..
and get
world->hello->null
Thanks,
Sumedh



On 6/16/07, Madhu B <[EMAIL PROTECTED]> wrote:
>
> [EMAIL PROTECTED] wrote:
>
> the reverse of "hello world" is "dlrow olleh" and not "world hello"
>
> Reversing chars is different from reversing words. In any case nobody
> is going to help you with your homework. So before asking for any
> concrete help post your trials...
>
> On Jun 16, 10:13 am, Misty <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote:
>
>
> Hello friends,
> i want 2 know how to write a program to reverse  strings  for instance a
> string is "hello world", i need to print it as "world hello". please post
> your answers as soon as possible.
>
>
>
>
>   First reverse the string and then reverse each word in the string
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to