Created
January 20, 2013 18:51
-
-
Save biwakonbu/4580694 to your computer and use it in GitHub Desktop.
C 言語に於けるグローバル変数の定義方法 ref: http://qiita.com/items/e485ca8b202a7b1f7851
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define GLOBAL_VALIABLE_DEFINE | |
#include "global.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "global.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef GLOBAL_H_INCLUDED | |
#define GLOBAL_H_INCLUDED | |
#ifdef GLOBAL_VALIABLE_DEFINE | |
#define GLOBAL | |
#else | |
#define GLOBAL extern | |
#endif | |
GLOBAL int global_valiable; | |
#endif /* GLOBAL_H_INCLUDED */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment