Considering the rules of scope in C++, what happens when a local variable and a global variable have the same name?
- The local variable takes precedence, hiding the global variable
- The compiler generates a warning but uses the global variable
- The global variable is used throughout, ignoring the local variable
- The program will automatically rename the local variable