The class doesn't sees the function "place();" in the main.cpp and the int x and int y is also not recognized when using it in the functions owned by the class:
Code:
#ifndef ORGAN_H
#define ORGAN_H
class Organ
{
public:
int x;
int y;
void kill(int a,int b);
void it_lives(int prop);
void SetCoord(int x, int y);
};
#endif // ORGAN_H
Code:
#include "organ.h"
void SetCoord(int x, int y)
{
place(x,y,"@");//ERROR: Undeclared
}
void kill(int a,int b)
{
x=a;//ERROR: x and y undefined
y=b;
place(x,y," ");
}
void it_lives(int prop)
{
if(prop==0)
{
kill(x,y);
}
}
place(); is defined in the main.cpp file. The header file is defined in the main.cpp.