#include<iostream>
using namespace std;
bool running = 1;
void newGameFunc();
void titleFunc();
int userInput = 0;
int playerInfo[2]; //player info, change variable to number of options for the player
int main() {
void titleFunc(); {
cout << "\t\t\t\t game dialogue \n\n\n";
cout << "\game dialogue";
cin >> userInput;
if (userInput == 1) {
newGameFunc();
}
else {
running = 0;
}
return 0;
}
titleFunc();
return 0;
void newGameFunc();{
cout << "game dialogue \n";
cout << "game dialogue.\n";
cout << "game dialogue";
cin >> userInput;
playerInfo[0] = userInput;
cout << "game dialogue\n";
cin >> userInput;
playerInfo[1] = userInput;
return; <--- the problem
}
while (running) {
}
return 0;
}
昨天我开始使用 C++ 编程,没有在线教程。这是我到目前为止所拥有的,但返回值有问题。它说'main':函数必须返回一个值。我指出了代码中的问题。我之前输入了一个值,它会出现更多错误。有人可以帮帮我吗?