- Joined
- Jan 14, 2005
- Messages
- 395
- Reaction score
- 2
Hello,
i finally got fixed my other error but when i pasted a piece of the code in { } than i get empty
variable how i fix it ?
this is my code
hope you understand it better now :sq_yellow
i finally got fixed my other error but when i pasted a piece of the code in { } than i get empty
variable how i fix it ?
this is my code
Code:
#include <iostream>
#include <windows.h>
#include <string>
using namespace std;
int main() {
system("TITLE Wizard Fight");
cout << "Wizard Fight" << endl << endl;
cout << "Made by Pascal Wever" << endl;
cout << "version 0.2" << endl << endl;
system("PAUSE");
system("CLS");
int lvl = 0;
cout << "Please Select your Character" << endl << endl;
Sleep(450);
cout << "1 - Wizard" << endl;
Sleep(450);
cout << "2 - Archer" << endl;
Sleep(450);
cout << "3 - Gunner" << endl;
Sleep(300);
cout << "please select a Character !"<< endl;
cin >> lvl;
if (lvl = 1) {
goto mage;
}
if (lvl = 2) {
goto archer;
}
if (lvl = 3) {
goto gunner;
}
//begin mage
mage:
system("CLS");
{
string wepName[8];
wepName[0] = "Sword";
wepName[1] = "Scythe";
wepName[2] = "Daggers";
wepName[3] = "Throwing Star";
wepName[4] = "Knife";
wepName[5] = "Axe";
wepName[6] = "Spear";
wepName[7] = "Shield";
}
goto fight;
//end mage
//begin archer
archer:
cout << "archer" << endl;
return(0);
//end archer
//begin gunner
gunner:
cout << "gunner" << endl;
return(0);
//end gunner
system("PAUSE");
fight:
{
string wepName[8];
cout << "0 - " << wepName[0] << endl;
cout << "1 - " << wepName[1] << endl;
cout << "2 - " << wepName[2] << endl;
cout << "3 - " << wepName[3] << endl;
cout << "4 - " << wepName[4] << endl;
cout << "5 - " << wepName[5] << endl;
cout << "6 - " << wepName[6] << endl;
cout << "7 - " << wepName[7] << endl;
system("PAUSE");
goto end;
}
end:
return(0);
}