adding global variables

This commit is contained in:
Jidong Xiao
2025-01-24 13:46:36 -05:00
committed by JamesFlare1212
parent 13a8805c07
commit 2d2aaa903b

View File

@@ -35,7 +35,7 @@ void func() {
}
```
- Static memory: variables allocated statically (with the keyword static), located at the data segment of the program's memory. They are are not eliminated when they go out of scope. They retain their values throughout the entire program execution, but are only accessible within the scope where they are defined. For example:
- Static memory: include global variables and variables declared with the static keyword, located at the data segment of the program's memory. They are are not eliminated when they go out of scope. They retain their values throughout the entire program execution, but are only accessible within the scope where they are defined. For example:
```cpp
static int counter;