(answered)how can i make the input able to work with multiple of words instead of 1 ?
using namespace std;
//for example if
"hello" output ="olleh"
but if the input is
"hello world" out put is still " olleh ".
Getline function which is in string header...
It allows accepting and reading single and multiple line strings from the input stream. In C++, the cin object also allows input from the user, but not multi-word or multi-line input.
cin stops when it encounters a blank space. That is why you only get one word.
getline accepts the blank spaces as part of the string and stops at the end of the line('\n'). or when you hit the enter key.
Here is a link which explains the parameters and ways you can use getline, as well as some problems you might encounter when using it.