Code:
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <cstdio>
using namespace std;
int open_menu1();
struct stats
{
int hp;
int mp;
int pl;
string items;
int wins;
int losses;
double time;
};
int main()
{
ofstream out;
ifstream in;
string save;
bool test;
int menu = 0;
while (menu != 4)
{
menu = open_menu1();
if (menu == 1)
{
test = true;
system("cls");
cout << "please enter where you want to save this DOS style?\n";
getline(cin,save);
out.open(save.c_str(), ios::out);
}
else if(menu == 2)
{
test = false;
system("cls");
cout << "\nplease enter DOS style where you want to load the file from?\n";
getline(cin,save);
in.open(save.c_str(),ios::in);
}
else if(menu == 3)
{
system("cls");
cout << "STOP ENTERING STUFF I HAVENT DONE YET\n";
}
else;
if (test == true)
out.close();
else
in.close();
return 0;
}
int open_menu1()
{
int choice;
cout << "1.new\n2.load\n3.options\n4.quit\n";
cin >> choice;
return choice;
}
:\Documents and Settings\Owner\Desktop\C++ 6 files\New Folder\text game.cpp(71) : error C2601: 'open_menu1' : local function definitions are illegal
C:\Documents and Settings\Owner\Desktop\C++ 6 files\New Folder\text game.cpp(78) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
the error is pointing to the first bracket on the open_menu1 function and i have no clue why none at all