C/C++の宿題を片付けます 107代目
■ このスレッドは過去ログ倉庫に格納されています
0396デフォルトの名無しさん
2008/05/22(木) 00:17:14#include<iostream>
class Rect{
public:
int left,top,right,bottom;
void Rect::SetRect(int left,int top,int right,int bottom){
this->left = left;
this->top = top;
this->right = right;
this->bottom = bottom;
}
void Rect::SetRectEmpty(void){
left = top = right = bottom = 0;
}
};
int main(void){
Rect rc;
rc.SetRect( 0, 0, 640, 480);
std::cout << "(" << rc.left << ", " << rc.top << ") - (" << rc.right << ", " << rc.bottom << ")" << std::endl;
rc.SetRectEmpty();
std::cout << "(" << rc.left << ", " << rc.top << ") - (" << rc.right << ", " << rc.bottom << ")" << std::endl;
return 0;
}
■ このスレッドは過去ログ倉庫に格納されています