★初心者にVisual C++を教えるスレ★ Part30at TECH
★初心者にVisual C++を教えるスレ★ Part30 - 暇つぶし2ch67:デフォルトの名無しさん
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) {}
};
--
では問題、実行せずに出力結果を予測しなさい。
# って、厳密には実装依存なのかな。


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch