このコードを使用すると、未処理の書き込み例外がスローされます。これは、atoi()関数を使用することであるとほぼ確信しています。
while(true){
char* item = "";
cin >> item;
int numItem = atoi(item);
if(numItem){
if(numItem<=backpackSpaces){
equipItem(backpack[numItem]);
break;
}else{
cout << "No such item." << endl;
}
}else if(item == "back"){
cout << "Choose an option from the original choices. If you can't remember what they were, scroll up." << endl;
break;
}else{
cout << "Command not recognised." << endl;
}
}