Re:C Questions and Answers
by kenjackson on Wednesday March 04, 2015 @01:58AM
(#9143054)
I just got the first one wrong and haven't written C code in a decade. I have to admit I haven't seen that construct used in any programs. I guess, no harm no foul, but still seems like an odd construct to allow.
[ Parent
| on HN ]
Re:C Questions and Answers
by foogoespop on Wednesday March 04, 2015 @04:22PM
(#9147453)
The first one would appear when using global variables which are shared across files, you just wouldn't see it as the pieces would usually be in separate files.
Something like:
/* file.h */
int global_i;
and you have: /* file.c */
int global_i = 0;
Then if file.c includes file.h both will be in the same file during compilation.