Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include
// Global variable x int x = 5; void myFunction() { // Local variable with the same name as the global variable int x = 22; printf("%d\n", x); // Refers to the local variable x } int main() { myFunction(); printf("%d\n", x); // Refers to the global variable x return 0; }
22
5