4 ms·
The original article makes it clear that this is how things work with C globals, not locals. If you compile and run this program with gcc -Wall -pedantic x.c &&
by MikeTaylor 12y ago
The original article makes it clear that this is how things work with C globals, not locals. If you compile and run this program with gcc -Wall -pedantic x.c && ./a.out there will be no errors and it will emit i=10 as expected:
int i;
int i=10;
#include<stdio.h>
int main(int argc, char *argv[]) {
printf("i=%d\n", i);
return 0;
}