Co może być nie tak?
błąd wyskakuje przy:
while(!file.eof())
case '8':
{
system("cls");
cout<<"Send your nick: ";
cin>>op;
const int wordc = 32;
for(int i=10;i>=0;i--)
{
const int size = 31;
Sleep(500);
system("cls");
cout<<i<<endl;
string names[size] = {"MAC-10 | Neon Rider", "M4A1-S | Hyper Beast", "FAMAS | Djinn", "Galil AR | Eco",
"Five-SeveN | Monkey Business", "UMP-45 | Grand Prix", "CZ75-Auto | Pole Position", "MAG-7 | Heat", "AWP | Worm God", "Sawed-Off | Origami","Negev | Man-o'-war","P250 | Valence","Desert Eagle | Bronze Deco","MP7 | Armor Core","AK-47 | Elite Build","MAC-10 | Neon Rider", "M4A1-S | Hyper Beast", "FAMAS | Djinn", "Galil AR | Eco",
"Five-SeveN | Monkey Business", "UMP-45 | Grand Prix", "CZ75-Auto | Pole Position", "MAG-7 | Heat", "AWP | Worm God", "Sawed-Off | Origami","Negev | Man-o'-war","P250 | Valence","Desert Eagle | Bronze Deco","MP7 | Armor Core","AK-47 | Elite Build","KNIFE!"
};
cout<<"You win : ";
fstream file("winner.txt", ios::out |ios:: trunc);
std::srand(std::time(NULL));
int index = rand()%size;
file << names[index] << endl;
file.close();
cout << names[index] << endl;
}
fstream file("winner.txt", ios::in);
std::srand(std::time(NULL));
if(!file.is_open())
{
cout << "Nie znaleziono pliku";
return 1;
}
goto start;
}
break;
case '0':
{
string wyniki[10];
int i = 0;
while(!file.eof())
{
file >> wyniki[i++];
}
}
file.close();