Sharing Class information

I have one base class and two derived classes, I have values in the derived class that I need for calculations in my base class.

How do I call it to that location. I tried using pointers but they don't get declared till the main... Can I declare them sooner?
if you are using values in functions of base class class you can pass the objects of derived class to that function and then using that object you can call get methods to get the required value.
Last edited on
I did that and I thought I was doing it wrong because the display doesn't show the right math. If I plug in the number with my calculator I get the right answer but the 'get' function I don't think is displaying the right information.... Could it be that I didn't initialize them in the constructor?
ie..R_minimumValue=0; and then in the get function I have the

1
2
3
4
{
	R_minimumValue = R_nominalValue*(1-R_tolerance);
	return R_minimumValue;
}


is that wrong should it just be the return>?
and I should initialize R_minimumValue equation in the constructor?
OR do I put the get methods under the base class as well?
Last edited on
Topic archived. No new replies allowed.