★初心者にVisual C++ ..
[2ch|▼Menu]
67:デフォルトの名無しさん
08/05/12 10:27:59
>>66
clock()だと間に合わないみたいねw
--
[foo@Corvus tmp]$ ./a.out
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
--
ってことで、こんな風にしてみた。
--
static int staticCounterForDefault;
static int staticCounterForCopy;

struct test
{
int a;
test() : a(++staticCounterForDefault) {}
test(const test & foo) : a(++staticCounterForCopy) {}
};
--
では問題、実行せずに出力結果を予測しなさい。
# って、厳密には実装依存なのかな。


次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

4854日前に更新/178 KB
担当:undef