   What's wrong with my code?
  Code:void PLAYER::AddMana(int amount){SetMana(mana + amount);}Error(s): 1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\player.cpp(20) : error C2065: 'mana' : undeclared identifier1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\player.cpp(20) : error C3861: 'SetMana': identifier not found   
  Nevermind! Sorry for the post figured it out.   ;  On a side note, although programming "style" is completely up to you, it's generally accepted that identifiers in all UPPERCASE should be used for constants and #define macros. Class identifiers should be written with the first letter of each word UPPERCASE and every other letter lowercase i.e. "Player", not "PLAYER".   ;  Okay I thought I fixed it. But now I got tons of errors I had 50 but I got down to 20.. lOl.. I've spent so much time just fixing these errors tonight and I still got 20 to go. Can you guys help me and see what's wrong with my code? Here are the errors:1>------ Build started: Project: Wrath RPG, Configuration: Debug Win32 ------1>Compiling...1>Town.cpp1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(82) : error C2065: 'player' : undeclared identifier1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(82) : error C2227: left of '->GetGold' must point to class/struct/union/generic type1>   type is ''unknown-type''1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(85) : error C2065: 'player' : undeclared identifier1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(85) : error C2227: left of '->SpendGold' must point to class/struct/union/generic type1>   type is ''unknown-type''1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(89) : error C2065: 'player' : undeclared identifier1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(89) : error C2227: left of '->GetHealth' must point to class/struct/union/generic type1>   type is ''unknown-type''1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(89) : error C2065: 'player' : undeclared identifier1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(89) : error C2227: left of '->GetMaxHealth' must point to class/struct/union/generic type1>   type is ''unknown-type''1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(90) : error C2065: 'player' : undeclared identifier1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(90) : error C2227: left of '->GetMana' must point to class/struct/union/generic type1>   type is ''unknown-type''1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(90) : error C2065: 'player' : undeclared identifier1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(90) : error C2227: left of '->GetMaxMana' must point to class/struct/union/generic type1>   type is ''unknown-type''1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(91) : error C2065: 'player' : undeclared identifier1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(91) : error C2227: left of '->SetHealth' must point to class/struct/union/generic type1>   type is ''unknown-type''1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(91) : error C2065: 'player' : undeclared identifier1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(91) : error C2227: left of '->GetMaxHealth' must point to class/struct/union/generic type1>   type is ''unknown-type''1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(92) : error C2065: 'player' : undeclared identifier1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(92) : error C2227: left of '->SetMana' must point to class/struct/union/generic type1>   type is ''unknown-type''1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(92) : error C2065: 'player' : undeclared identifier1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\town.cpp(92) : error C2227: left of '->GetMaxMana' must point to class/struct/union/generic type1>   type is ''unknown-type''1>Build log was saved at "file://c:\Users\Administrator\Documents\Visual Studio 2008\Projects\Wrath RPG\Wrath RPG\Debug\BuildLog.htm"1>Wrath RPG - 20 error(s), 0 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========A lot....I' in a mess! Help me! Aghh!   ;  All of those errors point to the same variable... 'player' , which has been never been declared within the appropriate scope, or not at all. In any case, the complier cannot find the variable.How and where is 'player' declared? Insure that town.cpp (or even town.h, assuming it exists) can see the declaration of the variable.   ;  It seem like you are using a class/struct called player that does not exists.   ;  Thanks guys for the help and quick responses, I fixed it. I had to change just a tiny thing and it fixed em all. I changed void Inn(){to this void Inn(PLAYER* player){in the town.cpp, I hate this tutorial dude. He doesn't explain nothing but I catch on to most of it.   ;  Out of curiosity which tutorial are you following?   ;  http://rdxgames.net/videotutorials.html   ;  Hey guys I started working on how my battle works in my game. I get these errors:1>------ Build started: Project: Wrath RPG, Configuration: Debug Win32 ------1>Compiling...1>Battle.cpp1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\item.h(13) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>   c:\program files\microsoft visual studio 9.0\vc\include\string.h(74) : see declaration of 'strcpy'1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\battle.cpp(148) : error C2601: 'ListMonsters' : local function definitions are illegal1>   c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\battle.cpp(10): this line contains a '{' which has not yet been matched1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\battle.cpp(164) : error C2601: 'AttackMonster' : local function definitions are illegal1>   c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\battle.cpp(10): this line contains a '{' which has not yet been matched1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\battle.cpp(180) : error C2958: the left parenthesis '(' found at 'c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\battle.cpp(174)' was not matched correctly1>c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\battle.cpp(197) : fatal error C1075: end of file found before the left brace '{' at 'c:\users\administrator\documents\visual studio 2008\projects\wrath rpg\wrath rpg\battle.cpp(10)' was matched1>Build log was saved at "file://c:\Users\Administrator\Documents\Visual Studio 2008\Projects\Wrath RPG\Wrath RPG\Debug\BuildLog.htm"1>Wrath RPG - 4 error(s), 1 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========Here is the battle.cpp code:// BATTLE#include "Library.h"void ListMonsters(MONSTER* list,int count);bool AttackMonster(PLAYER* player,MONSTER* monster);bool Battle(PLAYER* player,MONSTER* list,int count){while (player->GetHealth() > 0){//player goes firstcout << "You clench your " << player->GetWeapon()->GetName() << " tightly amd face the enemy.\n\n";//display enemy countif (count == 1){cout << "The " << list->GetName() << " stares at you menacingly.\n";Wait();}else{ListMonsters(list,count);}cout << "\n";//display player statscout << player->GetName() << endl;//health / maxhealth, mana / maxmanacout << "Health: " << player->GetHealth() << " / " << player->GetMaxHealth() << endl;cout << "Mana: " << player->GetMana() << " / " << player->GetMaxMana() << endl;cout << endl;int action = 0;while(true){cout << "1: Attack\n";cout << "2: Spell\n";cout << "3: Item\n\n";cout << ">";cin >> action;//action?if (action == 1)//attack{if (count == 1){//attack single monsterAttackMonster(player,list);}else{//ask for targetint target = 0;while (true){ListMonsters(list,count);cout << "\n0: Cancel\n\n";cout << "Which monster?\n";cout << ">";cin >> target;cin.ignore(10, '\n');if ( target > 0 && target <= count){//check if the target is aliveif (list[target].GetHealth() > 0){//attack the targetAttackMonster(player,&list[target-1]);break;}else{cout << "Invalid monster.\n\n"; }}else if (target ==0){//cancelled attackaction = 0;break;}}//end while target not chosen//}  if (action == 1)//followed through with attack break;}else if (action == 2)//spell{//display player spellsbreak;}else if (action == 3)//item{//display players item listbreak;}} //while attacking//check action//is enemy dead?//enemies turnif (count == 1){//have enemy fight}else{//loopfor (int loop=0;loop < count;loop++){//list[loop]}}cout << "Thou hast been slain.\n\n";return false; //you died}void ListMonsters(MONSTER* list,int count){cout << "Enemies\n";for (int loopname=0;loopname < count; loopname++){if (list[loopname].GetHealth() > 0){cout << loopname+1 << ": " << list[loopname].GetName();//output status effect//Goblin - poisoned}}Wait();}bool AttackMonster(PLAYER* player,MONSTER* monster){/*Damage Taken = ATT – APDamage Given = ( (ATT+Strength) / 2) TO (ATT+Strength) WITH (10-Strength)% Chance miss*///calculate miss?if (player->GetStrength() < 10){//generate random numberint random = (rand()%(10-player->GetStrength())+1;if (random == 1) //miss{cout << " You swing as hard as you can but miss horribly\n.";return false;}}//attack single monsterint pstr = player->GetStrength();int damagelow = ( (player->GetWeapon()->GetDamage() + pstr) /2 );int damagehigh = ( player->GetWeapon()->GetDamage() + pstr);//generate damageint damagegiven = (rand()%(damagehigh-damagelow))+damagelow;int totaldamage = damagegiven - monster->GetArmor();cout << "You injure the " << monster->GetName() << " for " << totaldamage << " health.\n";monster->LoseHealth(totaldamage);return true;}