I'm trying to inherit some private members of a class. I'm not going to put any of the other cpp files or .h files because this should only concern BoxClass.h, Bullet.h, and Bullet.cpp. In bullet.cpp in "Bullet::Bullet_Draw_Collision()" the programs not recognizing "ySize" from "BoxClass.h". I inherited "BoxClass" class to "Bullet" class. Why isn't the program recognizing this variable. Thanks!
edit: To simplify my question, why can't I inherit the ySize variable.
BoxClass.h:
#ifndef BOXCLASS_H
#define BOXCLASS_H
class BoxClass {
//prv variables
unsigned short int width, retrieveX;
int height, i, xSize, ySize, rightWall;
float space_Value, height_Count;
bool error;
int width_Var, height_Var, position_Var;
int speed_Var = 1;
unsigned short int horizontalCount = 0, verticleCount = 0;
public:
int Retrieve_X();
void Print_Rectangle_Moving(int x, int y, int horizontalSpaces, int verticleSpaces);
void Print_Solid_Rectangle();
void Rectangle_Movement(int speed);
//function shows area of individual spaces
float Rectangle_Area();
// constructor
BoxClass(int x, int y);
};
#endif
Bullet.h:
#ifndef BULLET_H
#define BULLET_H
class Bullet: private BoxClass{
public:
void Bullet_Draw_Collision();
//constructor
Bullet();
};
#endif
Bullet.cpp:
#include "BoxClass.h"
void Bullet::Bullet_Draw_Collision() {
ySize;
}
Bullet::Bullet() {
};