mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Add static description to C.
This commit is contained in:
parent
38de481179
commit
e63232d2de
@ -469,6 +469,13 @@ void testFunc() {
|
|||||||
extern int i; //i here is now using external variable i
|
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.";
|
char c[] = "This is a test.";
|
||||||
str_reverse(c);
|
str_reverse(c);
|
||||||
|
Loading…
Reference in New Issue
Block a user