mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-26 20:34:32 +03: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
|
||||
}
|
||||
|
||||
//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);
|
||||
|
Loading…
Reference in New Issue
Block a user