What is the scope of a global variable in a C program?
- Accessible throughout the entire program
- Limited to the file where it's declared
- Local to the function it's defined in
- Only within the main() function
In C, global variables have a scope that spans the entire program, meaning they can be accessed from any part of the code.
Loading...
Related Quiz
- When declaring a string literal in C, which character is automatically appended at the end?
- How are strings typically terminated in C?
- What happens if you try to modify a character in a string literal?
- How does function overloading in C++ enhance code readability and maintainability?
- In a C++ application, you notice that a function is being called with different types of arguments, but there is only one function definition. What feature of C++ could be allowing this behavior?