Hello, I made a class and now I want to store instances of those classes in an array. I looked it up and found it was as easy as:
className arrayName[x]
When I tried that I got this error:
error: no matching function for call to 'archerTower::archerTower()'|
My class:
// class
class archerTower{
float cX;
float cY;
float radius;
public:
archerTower(float,float,float);
float getcX(){return cX;}
float getcY(){return cY;}
float getRadius(){return radius;}
};
//constructor
archerTower::archerTower(float x, float y, float r)
{
cX = x;
cY = y;
radius = r;
}
And finally when I try to create the array:
archerTower archerTowerArray[4];
Can anyone please help me?