i have a prob wit my code
i have been workin on a suttin
i tryed to try it out today
but it said "parse error at end of output"
i looked at the code for hours and found nothing wrong
it also said untitled1.o was missing
here is the code
split into two files
untitled1:
#include
#include
#include "class.hpp"
int main()
{
fighter user;
cout << "Hp: " user->GetHp() <<" \n";
system("PAUSE");
return 0;
}
class.hpp:
class fighter
{
//this part is public
public:
//this is the constructor for the class
fighter() { hp=150; basehp=150; strength=18; defense=8; speed=5; potion=1; exp=0; expneeded=15;
weapon=small sword; shield=wooden shield; helmet=cap; armor=leather; armbrace=bronze; damage=10;
sdefense=2; hdefense=1; adefense=3; abdefense=1; defense=7; }
//this is the destructor for the class
~fighter();
//this is the function that returns the hp
int GetHp() { return hp; }
//this is the function that returns the strength
int GetStrength() { return strength; }
//this is the function that returns the defense
int GetDefense() { return defense; )
//this is the function that returns the speed
int GetSpeed() { return speed; }
//this is the function that returns the gold
int GetGold() { return gold; }
//this is the function that returns the # of potions
int GetPotions() { return potion; }
//this is the function that returns the exp of user
int GetExp() { return exp; }
//this is the function that returns the exp til level up
int GetExpNeeded() { return expneeded; }
//this is the function that returns the name of weapon
char GetWeapon() { return weapon; }
//this is the function that returns the name of shield
char GetShield() { return shield; }
//this is the function that sets the defense shield provides
void SetShield(int number) { sdefense=number; }
//this is the function that returns the name of armor
char GetArmor() { return armor; }
//this is the function that sets the defense armor provides
void SetArmor(int number) { adefense=number; }
//this is the function that returns the name of helmet
char GetHelmet() { return helmet; }
//this is the function that sets the defense helmet provides
void SetHelmet(int number) { hdefense=number; }
//this is the function that returns the name of arm brace
char GetArmBrace() { return armbrace; }
//this is the function that sets the defense arm braces provides
void SetArmBrace(int number) { abdefense=number; }
//this is the function that sets the defense
void SetDefense() { defense=sdefense+adefense+hdefense+abdefense; }
//this is the function that increases the stats by 5 and hp by 25
void IncreaseStats() { hp+=25; basehp+=25; strength+=5; defense+=5; speed+=5; }
//this function is the battle function against the tiger
void TigerBattle(enemy->GetHp(), enemy->GetDamage());
//this function is the battle function against the thief
void ThiefBattle(enemy->GetHp(), enemy->GetDamage());
//this fucntion is the battle function against warrior
void WarriorBattle(enemy->GetHp(), enemy->GetDamage());
//this function determines which enemy user faces
void RandomEnemy();
//this part is private
private:
//these are the variables
int hp;
int basehp;
int damage;
int strength;
int defense;
int speed;
int gold;
int potion;
int exp;
int expneeded;
char weapon[100];
char shield[100];
int sdefense;
char helmet[100];
int hdefense;
char armor[100];
int adefense;
char armbrace[100];
int abdefense;
};
see GetDefence()
you have ) instead of }
I wonder if that helps.
you have ) instead of }
I wonder if that helps.
God saw all that he had made. Shit happens sometimes. --the sixth day.
thanx man!!!
i didnt see that
it actually helped
but....
it still says untitled1.o is missing
wat the hell should i do?
should i write the whole thing over again?
i didnt see that
it actually helped
but....
it still says untitled1.o is missing
wat the hell should i do?
should i write the whole thing over again?
also, you need a output operator <>><>> between cout parameters...
Edited by - farmersckn on February 1, 2001 8:17:17 PM
Edited by - farmersckn on February 1, 2001 8:17:17 PM
Yesterday is the past, tomorrow is the future. Today is a gift, that is why we call it the present.
also, you need a output operator << between cout parameters...
Yesterday is the past, tomorrow is the future. Today is a gift, that is why we call it the present.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement