stringstream ss; string numberStr = "654321"; int num; ss << numberStr; ss >> num; cout << "str type:" << numberStr <<endl; cout << "convert to num:" << num <<endl;