1. If the global variable of C language is not initialized, its default value is 0. The reason is that global variables are stored in the bss segment after compilation.
2. Global variables in C language can be initialized at the same time as they are declared, but they cannot be assigned after they are declared.
Such as:
#include<stdio.h> int a = 10; int main(void) { printf("a = %d\n",a); }
This works fine and prints out a = 10.
But the following is not allowed, an error will be reported, because assignment cannot be done outside the function.
#include<stdio.h> int a; a=10; int main(void) { printf("a = %d\n",a); }