Derived class can't access protected variables in base class

Link to code:

header file: https://pastebin.com/078QyCmQ

implementation: https://pastebin.com/pJ8zYKSk

Hey everyone, I am having trouble with using the protected variables from my base class with my derived class. For some reason, the compiler gives me an unused parameter error for the base class constructor.

This is what I get:

shapes.cpp:15:1: warning: unused parameter ‘x_’ [-Wunused-parameter]
Shape::Shape(float x_, float y_, float z_, bool verbose_) : x_(0), y_(0), z_(0), verbose_(0)
^
shapes.cpp:15:1: warning: unused parameter ‘y_’ [-Wunused-parameter]
shapes.cpp:15:1: warning: unused parameter ‘z_’ [-Wunused-parameter]

When I try to use the variables in order to perform simple calculations such as calculating the volume and area. I am not sure what is wrong, can anyone help?
Did you mean
 
Shape::Shape(float x_, float y_, float z_, bool verbose_) : x_(x_), y_(y_), z_(z_), verbose_(verbose_)
?
That was the problem. Thank you very much!!!
Last edited on
Topic archived. No new replies allowed.