class A
{
protected:
void Foo();
};
class B : public A
{
void Bar()
{
Foo();
}
void Foo() // note: the same name as in A (which hides Foo() in A)
{
A::Foo();
}
};
ok,in my code iv saperated the implimentation of the class in other cpp
but it says that the "pointType " is NOT a class or a namespace name
this is part of the code:
1 2 3 4 5 6
void circle::printR()
{
cout <<"the center of the circle is ["<<pointType::printXY<<","<<poinType::getY<<"]"<<endl;
cout<<"witch has an area : "<<fixed<<showpoint<<setprecision(2)<<area()<<endl;
cout <<"and circumference : "<<circumference()<<endl;
}
what's the relation of circle and pointType? Is pointType the base class of circle like ('A' to 'B')?
if 'printXY' is a function you need to write at least 'printXY()'
yes,pointType is the base of the circle ..
i have updated the code and did 'print()
but no use.....even the setprecision is not recognized!! and i included the cmath.
the thing is that in the question they specify the number of questions i cant do the implemntation
of the code up.
from what you posted I don't see any reason fo that
"pointType " is NOT a class or a namespace name
Maybe there's a missing include or you've defined 'pointType' otherwise?
but this line in plain wrong: cout <<"the center of the circle is ["<<pointType::printXY<<","<<poinType::getY<<"]"<<endl;
this is certainly what you want cout <<"the center of the circle is ["<<getX()<<","<<getY()<<"]"<<endl; never forget '()'!
printXY() returns nothing so it can't be used in that context
i said that before you need to write parentheses in order to call a function in C/C++. Maybe you learned Pascal or Delphi?
You can call any function from a base class without (base_class::...) except you hide that base class function within your class.