input a string using #include<string> code example
Example 1: c++ reading string
#include <iostream>
#include <string>
string str;
getline(cin, str);
//str contains line
Example 2: how to print string data type in c++
printf("%s\n",someString.c_str());