SyntaxFix
Write A Post
Hire A Developer
Questions
This will also work
std::string s; std::cout<<"Enter the String"; std::getline(std::cin, s); char *a=new char[s.size()+1]; a[s.size()]=0; memcpy(a,s.c_str(),s.size()); std::cout<<a;