1
我有一个类可以说C++:调用类的变量从另一个类
class ABC
{
int x;
char y;
....
}
另一个类
class xyz{
int UseVariablOfABC(int a,char b)
// a and b are the variables/members declared in class ABC above
}
int xyz::UseVariablOfABC(int a,char b){
//Do some thing with a and b
}
XYZ类是从用户(抽象意味着他不能设定的值它的成员函数的参数在这里它是useVariableofABC),用户只能使用ABC类....在C++中是否可行...我是否需要在xyz中创建类ABC的对象......
任何建议plz ........
定义在ABC的方法来回报你x和y的值 – DumbCoder