I have to write a program that takes in a string from the user and reverses the string (i.e. it takes in "Hello all nice to meet you" and prints out "you meet to nice all Hello"). We have to use fgets to read in the line of input from the user and then use strtok with " \n" as delimeters to separate each individual word in the string. I've thought about it for a long time but I just can't come up with the right algorithm.
If the string is "birds and bees", how do I reverse this using the above method? My instructor used strtok(), sprintf(), strcpy(), and a temp array to iteratively create the reversed string. Any ideas are welcome because I am short on those, especially since this is supposed to be one of the easier ones in my assignment. Thanks for the help!