I guess you borrowed the code without noticing that it is supposed to be run from the command-line. You type the name of the program followed by the word which you want to be reversed.
e.g. your program is named 'reverse', at the command line type
reverse "emperor make jeopardy yield moon job incandescent stay set"
and press enter.
You can list the parameters received by your program like this:
1 2
for (int i=0; i<argc; i++)
cout << i << ": " << argv[i] << '\n';
Of course there's a way.
First get the input as a string.
Then use your code to process the characters in that string instead of the command-line parameter.