I have this script....
#include "Library.h"
bool Battle ()
{
int YourHealth;
int TheRatsHealth;
YourHealth=25;
TheRatsHealth=5 ;
char HurtRat;
bool BattleRat ()
{
cout <<"What would you like to do?";
cout <<"1.Hit The Rat";
cout <<"2.Kick The Rat";
cin >> HurtRat;
cin.ignore(20,' \n');
if (HurtRat == '1')
{
cout <<"You Hit The Rat";
TheRatsHealth=T heRatsHealth-1;
if TheRatsHealth<1
{
cout <<"You killed the Rat";
cin.get();
cin.ignore();
ImperialCity();
}
}
if (HurtRat == '2')
{
cout <<"You kick The Rat";
TheRatsHealth=T heRatsHealth-2;
}
}
}
and the error messages are
Battle.cpp In function `bool Battle()':
Battle.cpp expected primary-expression before "bool"
Makefile.win [Build Error] [Battle.o] Error 1
Battle.cpp expected `;' before "bool"
i cant figure out how to fix this.
if somebody knows, your help is appreciated---and if u have an idea on a diffenrt way to do this
#include "Library.h"
bool Battle ()
{
int YourHealth;
int TheRatsHealth;
YourHealth=25;
TheRatsHealth=5 ;
char HurtRat;
bool BattleRat ()
{
cout <<"What would you like to do?";
cout <<"1.Hit The Rat";
cout <<"2.Kick The Rat";
cin >> HurtRat;
cin.ignore(20,' \n');
if (HurtRat == '1')
{
cout <<"You Hit The Rat";
TheRatsHealth=T heRatsHealth-1;
if TheRatsHealth<1
{
cout <<"You killed the Rat";
cin.get();
cin.ignore();
ImperialCity();
}
}
if (HurtRat == '2')
{
cout <<"You kick The Rat";
TheRatsHealth=T heRatsHealth-2;
}
}
}
and the error messages are
Battle.cpp In function `bool Battle()':
Battle.cpp expected primary-expression before "bool"
Makefile.win [Build Error] [Battle.o] Error 1
Battle.cpp expected `;' before "bool"
i cant figure out how to fix this.
if somebody knows, your help is appreciated---and if u have an idea on a diffenrt way to do this
Comment