主页
C 语言
C 变量作用域
demo_scope_global3
运行 ❯
×
更改方向
保存代码
更改主题
#include
// Global variable int x = 5; void myFunction() { printf("%d\n", ++x); // Increment the value of x by 1 and print it } int main() { myFunction(); printf("%d\n", x); // Print the global variable x return 0; }
6
6