can u tell me y linker gives error when we try to define a variable in a header file and include this in more than one source file?
/*test.h*/ int i =0; /*1.c*/ #include "test.h" i++; /*2.c*/ #include "test.h" i++;
whereas the same works fine if i use static in header file.
i can understand that this gives no favour. still while discussing with my colleagues i came across this. can any one answer this?