C/C++の宿題を片付けます 111代目 at TECH
[2ch|▼Menu]
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