char szTest[512+1] = {0}; cin.getline(szTest, sizeof(szTest)-1); std::string strTest = std::string(szTest);