You almost certainly don't want to deal with char * if you can help it - you need the C++ std::string class:
#include <string> .. string name = "fred";
or the related stringstream class:
#include <sstream> #include <string> #include <iostream> using namespace std; int main() { int player = 0; int cpu = 0; ostringstream os; os << "You: " << player << " CPU: " << cpu; string s = os.str(); cout << s << endl; }
if you really need a character pointer (and you haven't said why you think you do), you can get one from a string by using its c_str() member function.
All this should be covered by any introductory C++ text book. If you haven't already bought one, get Accelerated C++. You cannot learn C++ from internet resources alone.