You are declaring the function bodies inside the main function, which is not valid. Also you’ve been using too many ‘}’-s.
Your code should look more like this:
#include
using namespace std;
const int MAX_ITEMS = 100;
bool running = 1;
int playerInfo[2];
void titleFunc();
int userInput = 0;
int playerLocation = 0;
void newGameFunc();
void titleFunc() {
cout << "tttt---Fantasee---nnn";
cout << "tttt 1:Playn";
cin >> userInput;
if (userInput == 1) {
newGameFunc();
}
else {
running = 0;
}
return;
}
void newGameFunc() {
cout << "Welcome to Fantasee, a world of adventure and danger. n";
cout << "To begin, please enter your gender: n 1. Male 2. Female";
cin >> userInput;
playerInfo[0] = userInput;
cout << "And what class do you wish to be? n 1. Wizard 2. Archer 3. Warrior 4. Trickster 5. Knight 6. Assassin";
cin >> userInput;
playerInfo[1] = userInput;
playerLocation = 1;
return;
}
int main() {
titleFunc();
newGameFunc();
while (running) {
}
if (playerLocation == 1){
cout << "You are in a dungeon. You have just woke up from escaping the execution of your father. You see a pathway to the North, and a large gaping hole to the South.n";
cout << "1. Go Southn 2. Go North";
cin >> userInput;
if (userInput == 1) playerLocation = 2;
else if (userInput == 2) playerLocation = 3;
}
return 0;
}