im am new to c++ (im learning it for about 3weeks) but i made a game and i wanted feedbak, newways i can improve it, and teach me using local variables.
Code:
#include <cstdlib>
#include <fstream>
#include <iostream>

using namespace std;

    int lvls = 0; 
    char cha[5];
    char load[153];
    char namew[50];
    char namek[50];
    char namee[50];
    char namet[50];
    char nameh[50];
    int money;
    int exp;
    int lvl;
    int lp;
    int hitpoints;
    int agility;
    int energy;
    int health;
    int Ehitpoints;
    int Eagility;
    int Eenergy;
    int Ehealth;
    int Points;
    char enemych[23];
    bool hw = 0;
    
    
struct chartype
{
       int hitpoints;
       int agility;
       int energy;
       int health;
       int cexp;
       int clvl;
       int cpoints;
       int cmoney;
};
    chartype wizard;
    
    chartype knight;
    
    chartype elf;
    
    chartype thief;
    
    chartype holy;
 
    chartype esk;
    
    chartype ek;
    
    chartype ed;
    
    chartype ew;
    
    chartype gl;
    
    chartype sw;

    
          
    
inline void Eatk()
{
       int meshif = rand()% 11;
       
       if (meshif <= 7 )
       {
        health -= Ehitpoints;
       }
       else if ( meshif > 7 )
       {
        cout<<"-------------- Enemy Spell ------------"<<endl;
        health -= Eenergy;
       }
}


inline void game()
{
           cout<<"START"<<endl<<endl;
    
    while (1)
    {
    cout<<"Your HP = "<<health<<"       Enemy HP = "<<Ehealth<<endl;
    cout<<"Chose: [A]tack  [H]eal [S]pell [R]un(if you are a coward)"<<endl;
    
    char choice[1];
    
    cin>> choice;
    
    if ( strcmp ( choice, "a")==0)
    {
         int randatk = rand()% 11;
         
         if (randatk <= 3)
         {
             cout<<"---------------- miss ----------------"<<endl;
         }
         else if ( randatk >3 && randatk != 10 )
         {
         Ehealth -= hitpoints;
         }
         
         else if ( randatk ==10 )
         {
              cout<<"-------------- 2X DMG --------------"<<endl;
              Ehealth -= hitpoints;
              Ehealth -= hitpoints;
         }
         
         int randatke = rand()% 11;
         
         if (randatke <=3)
         {
             cout<<"------------- enemy miss -------------"<<endl;
         }
         else if ( randatke >3 && randatke !=10 )
         {
          Eatk();
         }
         else if ( randatke ==10) 
         {
              cout<<"-------------- 2X DMG --------------"<<endl; 
              Eatk();
              Eatk();
         }
    }
    else if ( strcmp ( choice, "h")==0)
    {
         int heal = rand() % 2;
         
         if (heal == 1){  
         health += 40;
         }
         else 
         {
              cout<<"-------------- Heal miss --------------"<<endl;
         }
    Eatk();
         
    }
    else if ( strcmp ( choice, "s")==0)
    {
         int randspell = rand()% 11;
         
         if (randspell <= 4)
         {
             cout<<"---------------- miss ----------------"<<endl;
         }
         else if ( randspell >4 && randspell != 10)
         {
         Ehealth -= energy;
         }
         else if ( randspell ==10 )
         {
              cout<<"-------------- 2X DMG --------------"<<endl;
              Ehealth -= energy;
              Ehealth -= energy;
         }
         
         int randspe = rand()% 11;
         
         if (randspe <= 4)
         {
             cout<<"------------- enemy miss -------------"<<endl;
         }
         else if ( randspe >4 && randspe !=10 )
         {
          Eatk();
         }   
         else if ( randspe ==10 )
         {
              cout<<"------------ 2X DMG ENEMY ------------"<<endl;
              Eatk();
              Eatk();
         }
    }
    
    int run= rand()% 11;
    
    if ( strcmp ( choice, "r")==0 && strcmp ( load,"t" )!=0 )  
    {
         if ( run <= 4 )
         {
         cout<<"Bye, Bye... CHICKEN"<<endl;
         cin.get();
         break;
         }
         else if ( run > 4 )
         {
             cout<<"Can't Escape."<<endl<<endl;
             Eatk();
         }
         
    }
    if ( strcmp ( choice, "r")==0 && strcmp ( load,"t" )==0 )
    {
         if (run <=6 )
         {
         cout<<"Bye, Bye... CHICKEN"<<endl;
         cin.get();
         break;
         }
         else
         {
             cout<<"Can't Escape."<<endl<<endl;
             Eatk();
         }
    }
    
    if ( health <= 0 )
    {
         cout<<"Your HP = "<<health<<"       Enemy HP = "<<Ehealth<<endl;
         cout<<"You Lost"<<endl<<endl;
         if ( strcmp ( load, "w") ==0 )
         {
              ifstream hpts ( "wizard_health.dll" );
              hpts>>health;
              hpts.close();
         }
         if ( strcmp ( load, "k") ==0 )
         {
              ifstream hptsa ( "knight_health.dll" );
              hptsa>>health;
              hptsa.close();
         }
         if ( strcmp ( load, "e") ==0 )
         {
              ifstream hptsb ( "elf_health.dll" );
              hptsb>>health;
              hptsb.close();
         }
         if ( strcmp ( load, "t") ==0 )
         {
              ifstream hptsc ( "thief_health.dll" );
              hptsc>>health;
              hptsc.close();
         }
         if ( strcmp ( load, "h") ==0 )
         {
              ifstream hptsd ( "holy_health.dll" );
              hptsd>>health;
              hptsd.close();
         }
         break;
    }
    else if ( Ehealth <= 0 )
    {
         cout<<"Your HP = "<<health<<"       Enemy HP = "<<Ehealth<<endl;
         cout<<"You win"<<endl<<endl;
         Points++;
         if ( strcmp ( enemych, "s")==0)
         {
              exp+= 100;
              money+= 25;
         }
         else if ( strcmp ( enemych, "k")==0)
         {
              exp+= 200;
              money+= 50;
         }
         else if ( strcmp ( enemych, "d")==0)
         {
              exp+= 300;
              money+= 100;
         }
         else if ( strcmp ( enemych, "w")==0)
         {
              exp+= 500;
              money+= 150;
         }
         else if ( strcmp ( enemych, "g")==0)
         {
              exp+= 700;
              money += 250;
         }
         else if ( strcmp ( enemych, "s")==0)
         {
              exp+= 1000;
              money += 350;
         }
         

         if ( exp <= 500 )
         {
              lvl = 1;
              lvls = 1;
         }
         else if (exp >500 && exp <= 1400 && lvls ==1 )
         {
               lvl = 2;
               hitpoints += 10;
               energy += 10;
               lvls = 2 ;
         }
         else if (exp >1400 && exp <= 2600 && lvls ==2)
         {
                      lvl = 3;
                      hitpoints += 20;
                      energy += 20;
                      lvls = 3;
         }
         else if (exp >2600 && exp <= 3100 && lvls ==3)
         {
                      lvl = 4;
                      hitpoints += 30;
                      energy += 30;
                      lvls++;
         }
         else if (exp >3100 && exp <= 4000 && lvls ==4)
         {
                      lvl = 5;
                      hitpoints += 50;
                      energy += 50;
                      lvls++;
         }
         else if (exp >4000 && exp <= 4900 && lvls ==5)
         {
                      lvl = 6;
                      hitpoints += 60;
                      energy += 60;
                      lvls++;
         }
         else if (exp >4900 && exp <= 5800 && lvls ==6)
         {
                      lvl = 7;
                      hitpoints += 70;
                      energy += 70;
                      lvls++;
         }
         else if (exp >5800 && exp <= 6700 && lvls ==7)
         {
                      lvl = 8;
                      hitpoints += 80;
                      energy += 80;
                      lvls++;
         }
         else if (exp >6700 && exp <= 7600 && lvls ==8)
         {
                      lvl = 9;
                      hitpoints += 90;
                      energy += 90;
                      lvls++;
         }
         else if (exp >7600 && exp <= 8500 && lvls ==9)
         {
                      lvl = 10;
                      hitpoints += 100;
                      energy += 100;
                      lvls++;
         }
         else if (exp >8500 && exp <= 9400 && lvls ==10) 
         {
                      lvl = 11;
                      hitpoints += 110;
                      energy += 110;
                      lvls++;
         }
         else if (exp >9400 && exp <= 10300 && lvls ==11)
         {
                      lvl = 12;
                      hitpoints += 120;
                      energy += 120;
                      lvls++;
         }
         else if (exp >10300 && exp <= 11200 && lvls ==12)
         {
                      lvl = 13;
                      hitpoints += 130;
                      energy += 130;
                      lvls++;
         }
         else if (exp >11200 && exp <= 12000 && lvls ==13)
         {
                      lvl = 14;
                      hitpoints += 140;
                      energy += 140;
                      lvls++;
         }
         else if (exp >12000 && exp <= 13500 && lvls ==14)
         {
                      lvl = 15;
                      hitpoints += 150;
                      energy += 150;
                      lvls++;
         }
         else if (exp >13500 && exp <= 15000 && lvls ==15)
         {
                      lvl = 16;
                      hitpoints += 160;
                      energy += 160;
                      lvls++;
         }
         else if (exp >15000 && exp <= 16500 && lvls ==16)
         {
                      lvl = 17;
                      hitpoints += 170;
                      energy += 170;
                      lvls++;
         }
         else if (exp >16500 && exp <= 18000 && lvls ==17)
         {
                      lvl = 18;
                      hitpoints += 180;
                      energy += 180;
                      lvls++;
         }
         else if (exp >18000 && exp <= 20000 && lvls ==18)
         {
                      lvl = 19;
                      hitpoints += 190;
                      energy += 190;
                      lvls++;
         }
         else if (exp >20000 && lvls ==19)
         {
                      lvl = 20;
                      hitpoints += 200;
                      energy += 200;
                      lvls++;
                      hw++; 
                      
                      ifstream hwa ( "hw.dll" );
                      hwa>>hw;
                      hwa.close();
         }
         
         if ( strcmp ( load, "w") ==0)
         {
         ofstream a_file ( "wizard_points.dll", ios::trunc );
         a_file<<Points;
         a_file.close();
         ofstream o_file ( "wizard_money.dll", ios::trunc );
         o_file<<money;
         o_file.close();
         ofstream ov_file ( "wizard_lvl.dll", ios::trunc );
         ov_file<<lvl;
         ov_file.close();
         ofstream ex_file ( "wizard_exp.dll", ios::trunc );
         ex_file<<exp;
         ex_file.close();
         ofstream hpt_file ( "wizard_hitpoints.dll", ios::trunc );
         hpt_file<<hitpoints;
         hpt_file.close();
         ifstream hpts ( "wizard_health.dll" );
         hpts>>health;
         hpts.close();
         }
         else if ( strcmp ( load, "k") ==0)
         {
         ofstream a_file ( "knight_points.dll", ios::trunc );
         a_file<<Points;
         a_file.close();
         ofstream o_file ( "knight_money.dll", ios::trunc );
         o_file<<money;
         o_file.close();
         ofstream ov_file ( "knight_lvl.dll", ios::trunc );
         ov_file<<lvl;
         ov_file.close();
         ofstream ex_file ( "knight_exp.dll", ios::trunc );
         ex_file<<exp;
         ex_file.close();
         ofstream hpt_file ( "knight_hitpoints.dll", ios::trunc );
         hpt_file<<hitpoints;
         hpt_file.close();
         ifstream hpts ( "knight_health.dll" );
         hpts>>health;
         hpts.close();
         }
         else if ( strcmp ( load, "e") ==0)
         {
         ofstream a_file ( "elf_points.dll", ios::trunc );
         a_file<<Points;
         a_file.close();
         ofstream o_file ( "elf_money.dll", ios::trunc );
         o_file<<money;
         o_file.close();
         ofstream ov_file ( "elf_lvl.dll", ios::trunc );
         ov_file<<lvl;
         ov_file.close();
         ofstream ex_file ( "elf_exp.dll", ios::trunc );
         ex_file<<exp;
         ex_file.close();
         ofstream hpt_file ( "elf_hitpoints.dll", ios::trunc );
         hpt_file<<hitpoints;
         hpt_file.close();
         ifstream hpts ( "elf_health.dll" );
         hpts>>health;
         hpts.close();
         }
         else if ( strcmp ( load, "t") ==0)
         {
         ofstream a_file ( "thief_points.dll", ios::trunc );
         a_file<<Points;
         a_file.close();
         ofstream o_file ( "thief_money.dll", ios::trunc );
         o_file<<money;
         o_file.close();
         ofstream ov_file ( "thief_lvl.dll", ios::trunc );
         ov_file<<lvl;
         ov_file.close();
         ofstream ex_file ( "thief_exp.dll", ios::trunc );
         ex_file<<exp;
         ex_file.close();
         ofstream hpt_file ( "thief_hitpoints.dll", ios::trunc );
         hpt_file<<hitpoints;
         hpt_file.close();
         ifstream hpts ( "thief_health.dll" );
         hpts>>health;
         hpts.close();
         }
         else if ( strcmp ( load, "h") ==0)
         {
         ofstream a_file ( "holy_points.dll", ios::trunc );
         a_file<<Points;
         a_file.close();
         ofstream o_file ( "holy_money.dll", ios::trunc );
         o_file<<money;
         o_file.close();
         ofstream ov_file ( "holy_lvl.dll", ios::trunc );
         ov_file<<lvl;
         ov_file.close();
         ofstream ex_file ( "holy_exp.dll", ios::trunc );
         ex_file<<exp;
         ex_file.close();
         ofstream hpt_file ( "holy_hitpoints.dll", ios::trunc );
         hpt_file<<hitpoints;
         hpt_file.close();
         ifstream hpts ( "holy_health.dll" );
         hpts>>health;
         hpts.close();
         }
         ofstream l2 ( "l2.bmp" );
         l2<<lvls;
         l2.close();
         
         break;
    }
    
}  
}

inline void menu()
{
       while (1)
       {
       cout<<endl<<"[P]rocede to Battle"<<endl;
       cout<<"[S]hop"<<endl;
       cout<<"[I]nfo"<<endl;
       cout<<"[E]xit"<<endl;
       
       char menu[254];
       cin>>menu;
       
       if (strcmp ( menu, "p")==0)
       {
                  while ( 1 )
         {
         cout<<"Chose ur kind of enemy:"<<endl;
         cout<<"[S]ingle knight     [K]night"<<endl;
         cout<<"[D]ragoon           [W]yvern"<<endl;
         cout<<"[G]olem             [Si]lver Wyvern"<<endl;
         
         cin>>enemych;
         
         if ( strcmp ( enemych, "s")==0)
         {
               esk.agility = 10;
               esk.energy = 5;
               esk.health = 150;
               esk.hitpoints = 20;
               
               Ehitpoints = esk.hitpoints;
               Eagility = esk.agility;
               Eenergy = esk.energy;
               Ehealth = esk.health;
               
               game();
               break;
         }
         else if ( strcmp ( enemych, "k")==0 && Points >= 10)
         {
                 ek.agility = 10;
                 ek.energy = 5;
                 ek.health = 200;
                 ek.hitpoints = 30;
                 
               Ehitpoints = ek.hitpoints;
               Eagility = ek.agility;
               Eenergy = ek.energy;
               Ehealth = ek.health;
               
                 game();
                 break;
         }
         else if ( strcmp ( enemych, "k")==0 && Points < 10)
         { 
             cout<<"Not enough points"<<endl;
             cin.get(); 
         }
         
         else if ( strcmp ( enemych, "d")==0 && Points >= 20 )
         {
                  ed.agility = 20;
                  ed.energy = 20;
                  ed.health = 300;
                  ed.hitpoints = 40;
                  
                  Ehitpoints = ed.hitpoints;
                  Eagility = ed.agility;
                  Eenergy = ed.energy;
                  Ehealth = ed.health;
               
                  game();
                  break;
         }
         else if ( strcmp ( enemych, "d")==0 && Points < 20)
         { 
          cout<<"Not enough points"<<endl;
                cin.get(); 
         }
         else if ( strcmp ( enemych, "w")==0 && Points >= 50 )
         {
                  ew.agility = 30;
                  ew.energy = 50;
                  ew.health = 400;
                  ew.hitpoints = 40;
                  
               Ehitpoints = ew.hitpoints;
               Eagility = ew.agility;
               Eenergy = ew.energy;
               Ehealth = ew.health;
               
                  game();
                  break;
         }
         else if ( strcmp ( enemych, "w")==0 && Points < 50 )
         { 
              cout<<"Not enough points"<<endl<<endl; cin.get(); 
         }

         else if ( strcmp ( enemych, "g")==0 && Points >= 70 )
         {
                  gl.agility = 30;
                  gl.energy = 80;
                  gl.health = 650;
                  gl.hitpoints = 90;
                  
               Ehitpoints = gl.hitpoints;
               Eagility = gl.agility;
               Eenergy = gl.energy;
               Ehealth = gl.health;
               
                  game();
                  break;
         }
         else if ( strcmp ( enemych, "g")==0 && Points < 70 )
         { 
              cout<<"Not enough points"<<endl<<endl; cin.get(); 
         }
         else if ( strcmp ( enemych, "si")==0 && Points >= 80 )
         {
                  sw.agility = 40;
                  sw.energy = 100;
                  sw.health = 800;
                  sw.hitpoints = 80;
                  
               Ehitpoints = sw.hitpoints;
               Eagility = sw.agility;
               Eenergy = sw.energy;
               Ehealth = sw.health;
               
                  game();
                  break;
         }
         else if ( strcmp ( enemych, "si")==0 && Points < 80 )
         { 
              cout<<"Not enough points"<<endl<<endl; cin.get(); 
         }
         else
         {
             cout<<"Letter not acceptable."<<endl;
         }
         }
       }
       else if (strcmp ( menu, "s")==0)
       {
         cout<<"Buy [P]oints-10PTS--500 money"<<endl;
         cout<<"Buy [E]nergy-20ERG--700 money"<<endl;
         cout<<"Buy [A]tack--20ATK--700 money"<<endl;
         cout<<"[L]eave Shop"<<endl;
         
         
         char b[1];
         cin>> b;
         
         if (strcmp ( b, "p")==0 && money >= 500 )
         {
             money-= 500;
             Points+= 10;
         ofstream y_file ( "points.dll", ios::trunc );
         y_file<<Points;
         y_file.close();
         ofstream q_file ( "money.dll", ios::trunc );
         q_file<<money;
         q_file.close();
         }
         else if (strcmp ( b, "p")==0 && money < 500 )
         {
                cout<<"Not enough money. Sorry"<<endl;
         }
         
         else if (strcmp ( b, "e")==0 && money >= 700 )
         {
             money-= 700;
             energy+= 20;
         ofstream y_file ( "energy.dll", ios::trunc );
         y_file<<Points;
         y_file.close();
         ofstream q_file ( "money.dll", ios::trunc );
         q_file<<money;
         q_file.close();
         }
         else if (strcmp ( b, "e")==0 && money < 700 )
         {
                cout<<"Not enough money. Sorry"<<endl;
         }
         
         else if (strcmp ( b, "a")==0 && money >= 700 )
         {
             money-= 700;
             hitpoints+= 10;
         ofstream y_file ( "hitpoints.dll", ios::trunc );
         y_file<<Points;
         y_file.close();
         ofstream q_file ( "money.dll", ios::trunc );
         q_file<<money;
         q_file.close();
         }
         else  if (strcmp ( b, "a")==0 && money < 700)
         {
                cout<<"Not enough money. Sorry"<<endl;
         }
         else if (strcmp ( b, "e")==0)
         {}
       }
    else if (strcmp (menu, "i") ==0)
    {
         cout<<endl<<"You have "<<Points<<" points."<<endl;
         cout<<endl<<"You have "<<money<<" coins."<<endl;
         cout<<endl<<"You have "<<exp<<" experience."<<endl;
         cout<<endl<<"You have "<<hitpoints<<" Atack points."<<endl;
         cout<<endl<<"You have "<<energy<<" Energy."<<endl;
         cout<<endl<<"You are level "<<lvl<<"."<<endl;
    }
    else if (strcmp (menu, "e") ==0)
    {
         cout<<"Are u sure? (Y/N)"<<endl;
         
         char exit[1];
         cin>> exit;
         
         if ( strcmp ( exit, "y") ==0 )
         {
              break;
         }
         else if ( strcmp ( exit, "n") == 0 )
         {
         
         }
    }
}}


int main(int argc, char *argv[])
{

    

              
    ifstream b_file ("points.dll");
    b_file>>Points;
    if ( !b_file.is_open() )
    {
         Points = 0;
    }
    else 
    {
    }
    
    ifstream m_file ("money.dll");
    m_file>>money;
    if (!m_file.is_open ())
    {
        money = 0;
    }
    else {}
    
    ifstream exp_file ("exp.dll");
    exp_file>>exp;
    if (!exp_file.is_open ())
    {
        exp = 0;
    }
    else {}
    ifstream l_file ("lvl.dll");
    l_file>>lvl;
    if (!l_file.is_open ())
    {
        lvl = 1;
    }
    else {}
    ifstream l3( "l2.bmp" );
    l3>>lvls;
    l3.close();
    
    
    cout<<"  W E A L C O M E   T O :"<<endl; 
    cout<<"Wyvern's Knight Challenge:"<<endl;
    
    for (int xyz = 0; xyz < 1; xyz++)
    {
        system ("color 1");
        system ("color 2");
        system ("color 3");
        system ("color 4");
        system ("color 5");
        system ("color 6");
        system ("color 7");
        system ("color 8");
        system ("color 9");
        system ("color 0");
        system ("color a");
        system ("color b");
        system ("color c");
        system ("color d");
        system ("color e");
        system ("color f");
    }
        system ("color 7");
    cout<<endl<<endl;
    system("pause");
    cout<<endl;
    

    cout<<"Use ALWAYS smal letters (right: a, b, c... wrong: A, B, C...)"<<endl<<endl;    
    while( 1 )
  {

    cout<<endl<<"[G]enerate character "<<endl;
    cout<<"[L]oad character "<<endl;
    cout<<"[C]reditzzzzzzzzzzzz "<<endl;
    cout<<"[Q]uit (bye, bye) "<<endl;
    
    char cin1[10];
    cin>> cin1;
    cin.ignore();
    
    if ( strcmp (cin1, "g") == 0)
    {
         while (1)
         {
         cout<<endl<<"Select your Character"<<endl<<endl;
         cout<<"[W]IZARD      [K]night"<<endl;
         cout<<"[E]lf         [T]hief"<<endl;
         cout<<" << [H]oly Wyvern >>"<<endl;

         
         
         
         cin>> cha;
         
         
    
         
         if ( strcmp ( cha, "w") ==0)
         {
           cout<<"Enter it's name: ";
           cin>>namew;
         
         wizard.agility = 5;
         wizard.energy = 30;
         wizard.health = 200;
         wizard.hitpoints = 10;
         wizard.cexp = 0;
         wizard.clvl = 1;
         wizard.cmoney = 0;
         wizard.cpoints = 0;
                  
                  health = wizard.health;
                  hitpoints = wizard.hitpoints;
                  energy = wizard.energy;
                  agility = wizard.agility;
                  exp = wizard.cexp;
                  money =wizard.cmoney;
                  lvl = wizard.clvl;
                  Points = wizard.cpoints;

                  
                  ofstream wiz ("wizard_name.dll" );
                  wiz<<namew;
                  wiz.close();
                  
                  ofstream wiz_h ( "wizard_health.dll");
                  wiz_h<<health;
                  wiz_h.close();
                  
                  ofstream wiz_a ( "wizard_hitpoints.dll");
                  wiz_a<<hitpoints;
                  wiz_a.close();
                  
                  ofstream wiz_e ( "wizard_energy.dll");
                  wiz_e<<energy;
                  wiz_e.close();
                  
                  ofstream wiz_ag ("wizard_agility.dll");
                  wiz_a<<hitpoints;
                  wiz_a.close();
                  
                  ofstream wiz_ex ("wizard_exp.dll");
                  wiz_ex<<exp;
                  wiz_ex.close();
                  
                  ofstream wiz_lvl ("wizard_lvl.dll");
                  wiz_lvl<<lvl;
                  wiz_lvl.close();
                  
                  ofstream wiz_po ("wizard_points.dll");
                  wiz_po<<Points;
                  wiz_po.close();
                  
                  ofstream wiz_mo ("wizard_money.dll");
                  wiz_mo<<money;
                  wiz_mo.close();
                  
                  break;
         }
         else if ( strcmp ( cha, "k") == 0)
         {
              cout<<"Enter it's name:"<<endl;
              cin>> namek;
              
              knight.agility = 10;
              knight.energy = 5;
              knight.health = 200;
              knight.hitpoints = 30;
              knight.cexp = 0;
              knight.clvl = 1;
              knight.cmoney = 0;
              knight.cpoints = 0;
                  
              health = knight.health;
              hitpoints = knight.hitpoints;
              energy = knight.energy;
              agility = knight.agility;
              exp = knight.cexp;
              money =knight.cmoney;
              lvl = knight.clvl;
              Points = knight.cpoints;

                  
              ofstream kng ("knight_name.dll" );
              kng<<namek;
              kng.close();
                  
              ofstream kng_h ( "knight_health.dll");
              kng_h<<health;
              kng_h.close();
                  
              ofstream kng_a ( "knight_hitpoints.dll");
              kng_a<<hitpoints;
              kng_a.close();
                  
                  ofstream kng_e ( "knight_energy.dll");
                  kng_e<<energy;
                  kng_e.close();
                  
                  ofstream kng_ag ("knight_agility.dll");
                  kng_a<<hitpoints;
                  kng_a.close();
                  
                  ofstream kng_ex ("knight_exp.dll");
                  kng_ex<<exp;
                  kng_ex.close();
                  
                  ofstream kng_lvl ("knight_lvl.dll");
                  kng_lvl<<lvl;
                  kng_lvl.close();
                  
                  ofstream kng_po ("knight_points.dll");
                  kng_po<<Points;
                  kng_po.close();
                  
                  ofstream kng_mo ("knight_money.dll");
                  kng_mo<<money;
                  kng_mo.close();
                  break;
         }
         else if ( strcmp ( cha, "e") == 0)
         {
              cout<<"Enter it's name:"<<endl;
              cin>> namee;
              
              elf.agility = 20;
              elf.energy = 20;
              elf.health = 200;
              elf.hitpoints = 20;

              elf.cexp = 0;
              elf.clvl = 1;
              elf.cmoney = 0;
              elf.cpoints = 0;
                  
              health = elf.health;
              hitpoints = elf.hitpoints;
              energy = elf.energy;
              agility = elf.agility;
              exp = elf.cexp;
              money =elf.cmoney;
              lvl = elf.clvl;
              Points = elf.cpoints;

                  
              ofstream elf ("elf_name.dll" );
              elf<<namee;
              elf.close();
                  
              ofstream elf_h ( "elf_health.dll");
              elf_h<<health;
              elf_h.close();
                  
              ofstream elf_a ( "elf_hitpoints.dll");
              elf_a<<hitpoints;
              elf_a.close();
                  
                  ofstream elf_e ( "elf_energy.dll");
                  elf_e<<energy;
                  elf_e.close();
                  
                  ofstream elf_ag ("elf_agility.dll");
                  elf_a<<hitpoints;
                  elf_a.close();
                  
                  ofstream elf_ex ("elf_exp.dll");
                  elf_ex<<exp;
                  elf_ex.close();
                  
                  ofstream elf_lvl ("elf_lvl.dll");
                  elf_lvl<<lvl;
                  elf_lvl.close();
                  
                  ofstream elf_po ("elf_points.dll");
                  elf_po<<Points;
                  elf_po.close();
                  
                  ofstream elf_mo ("elf_money.dll");
                  elf_mo<<money;
                  elf_mo.close();
                  break;
         }
         else if ( strcmp ( cha, "t") == 0)
         {               
              cout<<"Enter it's name:"<<endl;
              cin>> namet;
              thief.agility = 20;
              thief.energy = 5;
              thief.health = 300;
              thief.hitpoints= 15;
              
              thief.cexp = 0;
              thief.clvl = 1;
              thief.cmoney = 0;
              thief.cpoints = 0;
                  
              health = thief.health;
              hitpoints = thief.hitpoints;
              energy = thief.energy;
              agility = thief.agility;
              exp = thief.cexp;
              money =thief.cmoney;
              lvl = thief.clvl;
              Points = thief.cpoints;

                  
              ofstream thief ("thief_name.dll" );
              thief<<namet;
              thief.close();
                  
              ofstream thief_h ( "thief_health.dll");
              thief_h<<health;
              thief_h.close();
                  
              ofstream thief_a ( "thief_hitpoints.dll");
              thief_a<<hitpoints;
              thief_a.close();
                  
                  ofstream thief_e ( "thief_energy.dll");
                  thief_e<<energy;
                  thief_e.close();
                  
                  ofstream thief_ag ("thief_agility.dll");
                  thief_a<<hitpoints;
                  thief_a.close();
                  
                  ofstream thief_ex ("thief_exp.dll");
                  thief_ex<<exp;
                  thief_ex.close();
                  
                  ofstream thief_lvl ("thief_lvl.dll");
                  thief_lvl<<lvl;
                  thief_lvl.close();
                  
                  ofstream thief_po ("thief_points.dll");
                  thief_po<<Points;
                  thief_po.close();
                  
                  ofstream thief_mo ("thief_money.dll");
                  thief_mo<<money;
                  thief_mo.close();
                  break;
         }    
         else if ( strcmp ( cha, "h") == 0 && hw == 1)
         {               
              cout<<"Enter it's name:"<<endl;
              cin>> nameh;
              holy.agility = 40;
              holy.energy = 100;
              holy.health = 600;
              holy.hitpoints= 90;
              
              holy.cexp = 0;
              holy.clvl = 1;
              holy.cmoney = 0;
              holy.cpoints = 0;
                  
              health = holy.health;
              hitpoints = holy.hitpoints;
              energy = holy.energy;
              agility = holy.agility;
              exp = holy.cexp;
              money =holy.cmoney;
              lvl = holy.clvl;
              Points = holy.cpoints;

                  
              ofstream holy ("holy_name.dll" );
              holy<<nameh;
              holy.close();
                  
              ofstream holy_h ( "holy_health.dll");
              holy_h<<health;
              holy_h.close();
                  
              ofstream holy_a ( "holy_hitpoints.dll");
              holy_a<<hitpoints;
              holy_a.close();
                  
                  ofstream holy_e ( "holy_energy.dll");
                  holy_e<<energy;
                  holy_e.close();
                  
                  ofstream holy_ag ("holy_agility.dll");
                  holy_a<<hitpoints;
                  holy_a.close();
                  
                  ofstream holy_ex ("holy_exp.dll");
                  holy_ex<<exp;
                  holy_ex.close();
                  
                  ofstream holy_lvl ("holy_lvl.dll");
                  holy_lvl<<lvl;
                  holy_lvl.close();
                  
                  ofstream holy_po ("holy_points.dll");
                  holy_po<<Points;
                  holy_po.close();
                  
                  ofstream holy_mo ("holy_money.dll");
                  holy_mo<<money;
                  holy_mo.close();
                  break;
         }
         else if ( strcmp ( cha, "h") == 0 && hw == 0) 
         {
              cout<<"U must have any character at level 20 before using Holy Wyvern"<<endl;
              cin.get();
         }
    }}
    
    else if (strcmp (cin1, "l") ==0)
    {
         cout<<endl<<"Which u want to load?"<<endl;
         ifstream w1 ( "wizard_name.dll" );
         w1>>namew;
         w1.close();
         ifstream k1 ( "knight_name.dll" );
         k1>>namek;
         k1.close();
         ifstream e1 ( "elf_name.dll" );
         e1>>namee;
         e1.close();
         ifstream t1 ( "thief_name.dll" );
         t1>>namet;
         t1.close();
         ifstream h1 ( "holy_name.dll" );
         h1>>nameh;
         h1.close();
         
         
         cout<<endl<<"(Remember that if u didn't made a character and u load it game may crash)"<<endl<<endl;

         cout<<namew<<" -- press w"<<endl;
         cout<<namek<<" -- press k"<<endl;
         cout<<namee<<" -- press e"<<endl;
         cout<<namet<<" -- press t"<<endl;
         cout<<nameh<<" -- press h"<<endl;

         
         cin>>load;
         
         if (strcmp (load,"k") ==0)
         {
                    ifstream k2 ( "knight_health.dll" );
                    k2>>health;
                    k2.close();
                  
                    ifstream k3 ( "knight_hitpoints.dll");
                    k3>>hitpoints;
                    k3.close();
                  
                    ifstream k4 ( "knight_energy.dll");
                    k4>>energy;
                    k4.close();
                  
                    ifstream k5 ( "knight_agility.dll");
                    k5>>hitpoints;
                    k5.close();
                    
                    ifstream k6 ( "knight_exp.dll");
                    k6>>exp;
                    k6.close();
                    
                    ifstream k7 ( "knight_lvl.dll");
                    k7>>lvl;
                    k7.close();
                    
                    ifstream k8 ( "knight_points.dll");
                    k8>>Points;
                    k8.close();
                    
                    ifstream k9 ( "knight_money.dll");
                    k9>>money;
                    k9.close();        
         }
         else if (strcmp (load,"w") ==0)
         {
              ifstream w2 ( "wizard_health.dll" );
                    w2>>health;
                    w2.close();
                  
                    ifstream w3 ( "wizard_hitpoints.dll");
                    w3>>hitpoints;
                    w3.close();
                  
                    ifstream w4 ( "wizard_energy.dll");
                    w4>>energy;
                    w4.close();
                  
                    ifstream w5 ( "wizard_agility.dll");
                    w5>>hitpoints;
                    w5.close();
                    
                    ifstream w6 ( "wizard_exp.dll");
                    w6>>exp;
                    w6.close();
                    
                    ifstream w7 ( "wizard_lvl.dll");
                    w7>>lvl;
                    w7.close();
                    
                    ifstream w8 ( "wizard_points.dll");
                    w8>>Points;
                    w8.close();
                    
                    ifstream w9 ( "wizard_money.dll");
                    w9>>money;
                    w9.close();
         }
         else if (strcmp (load,"e") ==0)
         {
                    ifstream e2 ( "elf_health.dll" );
                    e2>>health;
                    e2.close();
                  
                    ifstream e3 ( "elf_hitpoints.dll");
                    e3>>hitpoints;
                    e3.close();
                  
                    ifstream e4 ( "elf_energy.dll");
                    e4>>energy;
                    e4.close();
                  
                    ifstream e5 ( "elf_agility.dll");
                    e5>>hitpoints;
                    e5.close();
                    
                    ifstream e6 ( "elf_exp.dll");
                    e6>>exp;
                    e6.close();
                    
                    ifstream e7 ( "elf_lvl.dll");
                    e7>>lvl;
                    e7.close();
                    
                    ifstream e8 ( "elf_points.dll");
                    e8>>Points;
                    e8.close();
                    
                    ifstream e9 ( "elf_money.dll");
                    e9>>money;
                    e9.close();
         }
         else if (strcmp (load,"t") ==0)
         {
              ifstream t2 ( "thief_health.dll" );
                    t2>>health;
                    t2.close();
                  
                    ifstream t3 ( "thief_hitpoints.dll");
                    t3>>hitpoints;
                    t3.close();
                  
                    ifstream t4 ( "thief_energy.dll");
                    t4>>energy;
                    t4.close();
                  
                    ifstream t5 ( "thief_agility.dll");
                    t5>>hitpoints;
                    t5.close();
                    
                    ifstream t6 ( "thief_exp.dll");
                    t6>>exp;
                    t6.close();
                    
                    ifstream t7 ( "thief_lvl.dll");
                    t7>>lvl;
                    t7.close();
                    
                    ifstream t8 ( "thief_points.dll");
                    t8>>Points;
                    t8.close();
                    
                    ifstream t9 ( "thief_money.dll");
                    t9>>money;
                    t9.close();
         }
         else if (strcmp (load,"h") ==0)
         {
              system("color 0F");
                    ifstream h2 ( "holy_health.dll" );
                    h2>>health;
                    h2.close();
                  
                    ifstream h3 ( "holy_hitpoints.dll");
                    h3>>hitpoints;
                    h3.close();
                  
                    ifstream h4 ( "holy_energy.dll");
                    h4>>energy;
                    h4.close();
                  
                    ifstream h5 ( "holy_agility.dll");
                    h5>>hitpoints;
                    h5.close();
                    
                    ifstream h6 ( "holy_exp.dll");
                    h6>>exp;
                    h6.close();
                    
                    ifstream h7 ( "holy_lvl.dll");
                    h7>>lvl;
                    h7.close();
                    
                    ifstream h8 ( "holy_points.dll");
                    h8>>Points;
                    h8.close();
                    
                    ifstream h9 ( "holy_money.dll");
                    h9>>money;
                    h9.close();
         }
         menu();
     }
    else if (strcmp (cin1, "c") ==0)
    {
         cout<<"CREDITZ:\n PROGRAMMING: Wyvern"<<endl;
         cin.get();
    }
    else if ( strcmp ( cin1, "iwantholywyvern") == 0 )
    { hw = 1;}
    else if ( strcmp ( cin1, "q") == 0 )
    {
         cout<<"Are u sure? (Y/N)"<<endl;
         
         char cin2[1];
         cin>> cin2;
         
         if ( strcmp ( cin2, "y") ==0 )
         {
              return 0;
         }
         else if ( strcmp ( cin2, "n") == 0 )
         {
         
         }
    }
 }

    
    cin.get();
    return EXIT_SUCCESS;
}
please i want feedbak