   help on my code
  could someone help me on my code my first header isclass human{int twoint threeint fourvoid attack(int &amount, enemy &name);void magic(int &type, enemy &name);};my second header isclass enemy{int twoint threeint fourvoid attack(int &amount, human &name);void magic(int &type, human &name);};the functions are in there own source file the problem is when i try to run it it says class enemy not declared in the first and class human in the second and if i declare them by #include "human.h" and #include "orc.h" the compilation doesn't end any help?   
#ifndef _HUMAN_H_#define _HUMAN_H_class enemy;// Forward declaration of the enemy classclass human{int two;int three;int four;void attack(int &amount, enemy &name);void magic(int &type, enemy &name);};#endif#ifndef _ENEMY_H_#define _ENEMY_H_class human;// Forward declaration of the human classclass enemy{int two;int three;int four;void attack(int &amount, human &name);void magic(int &type, human &name);};#endifThen, in enemy.cpp include human.h, and in human.cpp include enemy.h   ;  Hi you could use #pragma once at the top of your header files to stop it from compiling more than once when you include your opposite file. Otherwise say your human.h file just includes enemy.h which includes human.h so your compiler will get stuck in a loop.////////////////////////////////////////// HUMAN.H////////////////////////////////////////#pragma once#include "enemy.h"class human{    int two    int three    int four    void attack(int &amount, enemy &name);    void magic(int &type, enemy &name);};////////////////////////////////////////// enemy.H////////////////////////////////////////#pragma once#include "human.h"class enemy{    int two    int three    int four    void attack(int &amount, human &name);    void magic(int &type, human &name);};;  thank you i just started learning last week   ;  you might want to join the C++ workshop that is starting up here on gamedev right away.   ;  i will join thanks oh and another thing is there a way i could call a function that needs parameters from a function in a class for instance:#pragma once#include "enemy.h"class enemy;class human{int one;int two;void damage(human &name, enemy &mon){cout<<name.one<<mon.two<<endl;}void attack(int amount, human &name, enemy &mon){int amount=name.one;mon.two-=amount;damage(human &name, enemy &mon);}};because when i do it it doesnt work   ;  with the function parameters being pointers (&name) you may find that using name->one and name->two will work better. Oh and when calling a function you can simply say damage(&name,&mon) to pass the updated variables to the next routines calculations.Apart from that what happens when you compile or run the program with the code like that ?;Quote:Original post by Xrystalwith the function parameters being pointers (&name) you may find that using name->one and name->two will work better.The arguments are references, not pointers, so the . syntax is correct.@The OP: It looks like the problem may be access privilages; try making the member variables of 'enemy' public and see if that works.Once you get it working, the next step is probably to revise the design to reflect OOP principals such as encapsulation (assuming that's what you're going for).   ;  thanks guys   ;void attack(int amount, human &name, enemy &mon){int amount=name.one;mon.two-=amount;damage(human &name, enemy &mon);}When you *call* a function, *do not* include the names of the types. Just provide arguments that are of appropriate types.A function definition says what to do with a given set of things (and includes names that will be used for those things within the function, for the sake of writing that definition). A call says "do the action with *these* things" (which could be differently named, or even be the result of some expression rather than just a variable.Examples:class Thing {  void doSomething() const {    // something wonderful happens here  }};int foo(const Thing& x, int bar) {  x.doSomething();  return bar * 3;}int quux() {  Thing wibble;  return foo(wibble, // notice, not named "x", and we don't put the types   10 + 3); // notice an expression, no variable  // 'foo' takes in the Thing, makes it doSomething(), and then returns  // 13 * 3, i.e. 39. Then quux() returns the result of the foo() call, i.e. 39.}