how do i avoid this linking error ?
- by Yogesh
if i have defined a global variable(with initialization) in header file, and included this file in two file and try to compile and link, compiler gives linking error
-----------------
>>headers.h
#ifndef __HEADERS
#define __HEADERS
int x = 10;
#endif
>>1.c
#include "headers.h"
main ()
{
}
---------------------
>>2.c
#include "headers.h"
fun () {}