From 8caf3768fb4a1f0fa14ca4765e7f168534c7cd8f Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Sat, 31 Aug 2013 19:24:15 -0500 Subject: Add extern notes to C. --- c.html.markdown | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/c.html.markdown b/c.html.markdown index ee60d168..2a828ab7 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -99,7 +99,7 @@ int main() { unsigned int ux_int; unsigned long long ux_long_long; - // chars inside single quotes '*' are ASCII versions of + // chars inside single quotes '*' are character constants. '0' //==> 48 on the ASCII table. 'A' //==> 65 on the ASCII table. @@ -472,6 +472,12 @@ while ((c = getchar()) != EOF) { // EOF constant "end of file". char c = getchar(); } +//if referring to external variables outside function, must use extern keyword. +int i = 0; +void testFunc() { + extern int i; //i here is now using external variable i +} + /* char c[] = "This is a test."; str_reverse(c); -- cgit v1.2.3