Global variables, when declared outside all functions, have ______ storage duration by default.
- auto
- extern
- static
- volatile
When global variables are declared outside all functions, they have static storage duration by default. Static storage duration means they exist for the entire program's lifetime.
Loading...
Related Quiz
- Which function is used to get the position of the file pointer in a file?
- What is the primary purpose of using enum in C++?
- Which parameter-passing method does not allow the function to modify the actual argument?
- Why is the use of the "using namespace std;" directive common in C++ programs?
- Which type of loop is best suited when the number of iterations is known ahead of time?