mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Edit static description wording. Add note about private functions.
This commit is contained in:
parent
e63232d2de
commit
af9cc6e9b9
@ -469,12 +469,12 @@ 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
|
//make external variables private to source file with static:
|
||||||
// they are declared in, use static:
|
static int i = 0; //other files using testFunc() cannot access variable i
|
||||||
static int i = 0; //other source files using testFunc() cannot access variable i
|
|
||||||
void testFunc() {
|
void testFunc() {
|
||||||
extern int i;
|
extern int i;
|
||||||
}
|
}
|
||||||
|
//**You may also declare functions as static to make them private**
|
||||||
|
|
||||||
/*
|
/*
|
||||||
char c[] = "This is a test.";
|
char c[] = "This is a test.";
|
||||||
|
Loading…
Reference in New Issue
Block a user