Since you're using C++, try the user-friendly C++ std::string, instead of not-so-user-friendly C-style char array.
So, essentially:
Code:
#include <iostream>
#include <string>
int main()
{
std::string UserEnteredString;
std::cin >> UserEnteredString;
std::cout << UserEnteredString << '\n';
}
Incidentally, you don't have to print out your C-style char array "buffer" character-by-character, you can simply stream the entire thing via cout:
http://www.cplusplus.com/reference/i...tream/getline/