Q:
Write a function to reverse the words in the sentence,
for example "This is a string " becomes "string a is This".
A: anony
A straightforward solution: split the string, get pointer to each word
(strtok function will work), copy words in a reverse order into
another string.
A: Tanit
SimpleLogic(char myStr[]) // pass the string
{
char *t=myStr;
while(*t)
if(*t==' ')
*t++='\0';
else
++t;
--t;
while(t>myStr)
if(*t=='\0')
--t;
else
printf("%s\n",(t-- + 1));
printf("%s",myStr);
}