如何转换c+中使用的stoi+;11点到atoi? 我现在不能真正更新我的C++编译器,想知道我怎样才能把 STOI改为 ATOI >而不需要编译错误 int getInput(int columns) { // declare the variable to hold user input int userInput; string userValue; // prompt for the column number and read the column number cout << "Enter a column between 1 and " << columns << " to play in: "; cin >> userValue; // loop to check the input validation while (!validateUserInput(userValue) || (stoi(userValue) < 1) || (stoi(userValue) > columns)) { // re-prompt the user for the input cout << "Enter a column between 1 and " << columns << " to play in: "; cin >> userValue; } userInput = stoi(userValue); // return the input return userInput; } intgetInput(int列) { //声明用于保存用户输入的变量 int用户输入; 字符串用户值; //提示输入列号并读取列号 cout(列) { //重新提示用户输入 cout

如何转换c+中使用的stoi+;11点到atoi? 我现在不能真正更新我的C++编译器,想知道我怎样才能把 STOI改为 ATOI >而不需要编译错误 int getInput(int columns) { // declare the variable to hold user input int userInput; string userValue; // prompt for the column number and read the column number cout << "Enter a column between 1 and " << columns << " to play in: "; cin >> userValue; // loop to check the input validation while (!validateUserInput(userValue) || (stoi(userValue) < 1) || (stoi(userValue) > columns)) { // re-prompt the user for the input cout << "Enter a column between 1 and " << columns << " to play in: "; cin >> userValue; } userInput = stoi(userValue); // return the input return userInput; } intgetInput(int列) { //声明用于保存用户输入的变量 int用户输入; 字符串用户值; //提示输入列号并读取列号 cout(列) { //重新提示用户输入 cout,c++,c,C++,C,首先,将#include添加到您的代码中,以使用atoi(如果您没有) 然后,将stoi(userValue)替换为atoi(userValue.c_str())请不要垃圾发送语言标签。

首先,将
#include
添加到您的代码中,以使用
atoi
(如果您没有)


然后,将
stoi(userValue)
替换为
atoi(userValue.c_str())

请不要垃圾发送语言标签。