C/C++の宿題を片付けます 111代目
at TECH
209:デフォルトの名無しさん
08/06/29 21:20:31
>>206
#include <iostream>
#include <ctime>
using namespace std;
class myclass {
int x;
public:
myclass() { x = 0; }
myclass(int n) { x = n; }
myclass(time_t t) { x = t; }
int getx() { return x; }
};
int main()
{
myclass o1(10);
myclass o2;
myclass o3(time(0));
cout << "o1: " << o1.getx() << '\n';
cout << "o2: " << o2.getx() << '\n';
cout << "o3: " << o3.getx() << '\n';
return 0;
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5396日前に更新/196 KB
担当:undef