C++相談室 part39
■ このスレッドは過去ログ倉庫に格納されています
0024デフォルトの名無しさん
05/01/26 21:58:08class point{
private:
int x;
int y;
public:
point(int a,int b){x = a; y = b;}
virtual void show();
};
void point::show()
{
cout << "x:" << x << endl;
cout << "y:" << y << endl;
}
class 3Dpoint:public point{
private:
int z;
public:
3Dpoint(int a,int b,int c):point(a,b){z = c;}
void show();
};
void 3Dpoint::show()
{
cout << "x:" << x << endl;
cout << "y:" << y << endl;
cout << "z:" << z << endl;
}
■ このスレッドは過去ログ倉庫に格納されています