Reverse a sentence?

Sentence is a sequences of words separted by one or more spaces/tabs

You need to reverese a given sentence like the e.g below

input: "this is a cool one"

output: "one cool a is this"

say me if this is ok...

#include
char* reverse_word(char* s)
{
char *str = s;
int len = string_len(s);
int i=0;
int count=0;

reverse_substring(str,0,pos_lastChar(s));
printf("the reversed: %s",str);
while(i<=len){
if(str[i] ==' ' || i==len){
reverse_substring(str,i-count,i-1);
count=0;
}
if(str[i]!=' '){
count++;
}
i++;
}
return str;
}

int pos_lastChar(char* s)
{
int i;
for(i=string_len(s); i>0;i--){
if (s[i] != ' ' && s[i] != '\0'){
return i;
}
}
}
reverse_substring(char* s, int start, int end)
{
char temp;
int i,j;
for(i=start, j=end; i

Reverse a sentence?

take an array of strings and take the words of a sentence as elements of that strings. Now print out then in oposit order . An easy task. Isnt it?