Once again, I'm having serious OOP problems. I just compiled a program I've been working on, and got ten errors. I've managed to get it down to two syntax errors, but I can't seem to find them!! I'll post a snippet of the code my compiler is marking as bugged. If you need the WHOLE code, I can give it to you. :
These snippets are methods of the classes Enemy and Player (first is enemy, second is player). These are friendly classes, so they should be able to access each others' variables. It says there is a "syntax error before `;' token" on the lines reassigning Enemy.eHP and Player.pHP, but I can't find one. Do you guys see any syntax errors??
--------------------------------------
Programming is officialy a life skill
I have no idea what MIS means
Code:
int Attack()
{
cout << "Enemy attacks!" << endl;
Player.pHP = Player.pHP - ((eAttack * 10) - (Player.pDefend * 5));
}
Code:
{
cout << "Player attacks!!!" << endl;
Enemy.eHP = Enemy.eHP ((pAttack * 10)-(Enemy.eDefend * 5));
}
These snippets are methods of the classes Enemy and Player (first is enemy, second is player). These are friendly classes, so they should be able to access each others' variables. It says there is a "syntax error before `;' token" on the lines reassigning Enemy.eHP and Player.pHP, but I can't find one. Do you guys see any syntax errors??
--------------------------------------
Code:
//Program to tick off my sister
I have no idea what MIS means