はきだめC/C++下級者の質問箱 2 at TECH
[2ch|▼Menu]
660:デフォルトの名無しさん
08/03/25 03:10:31
>>653
[main.cpp]
#include <stdio.h>
void hoge_inc(void);
void hage_inc(void);
int count;
int main(int argc, char *argv[]) {
    count = 0;
    hoge_inc();
    printf("count = %d\n", count);
    hage_inc();
    printf("count = %d\n", count);
    return 0;
}
[hoge.cpp]
extern int count;
void hoge_inc(void) {
    count++;
}
[hage.cpp]
extern int count;
void hage_inc(void) {
    count++;
}


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

4762日前に更新/249 KB
担当:undef