mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Add extern notes to C.
This commit is contained in:
parent
d632203255
commit
8caf3768fb
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user