diff options
author | Levi Bostian <levi.bostian@gmail.com> | 2013-11-24 14:17:32 -0600 |
---|---|---|
committer | Levi Bostian <levi.bostian@gmail.com> | 2013-11-24 14:17:32 -0600 |
commit | e63232d2de1e2058dd381fe1094c7f775f2e3eb8 (patch) | |
tree | deec47b8be8804cd8a9da8b8e7e354e1081593f9 /c.html.markdown | |
parent | 38de481179484d597d44fa934f87a5f21ebfaa6c (diff) |
Add static description to C.
Diffstat (limited to 'c.html.markdown')
-rw-r--r-- | c.html.markdown | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/c.html.markdown b/c.html.markdown index b4a874d3..7b95c969 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -469,6 +469,13 @@ void testFunc() { extern int i; //i here is now using external variable i } +//if external variable should only be visible to functions in the source file +// they are declared in, use static: +static int i = 0; //other source files using testFunc() cannot access variable i +void testFunc() { + extern int i; +} + /* char c[] = "This is a test."; str_reverse(c); |