title: How to access a structure declared in other file using extern keyword in 'c' language
body: <p>I have 3 files . In one file I declared a structure and in another file which has the main, I am trying to access that structure using extern key word --------</p>
  
  <pre><code>//a.c---
  
  include&lt;stdio.h&gt;
  extern struct k  ;
  extern int c;
  int main()
  {
    extern int a,b;
    fun1();
    fun2();
    c=10;
    printf("%d\n",c);
    struct k j;
    j.id=89;
    j.m=43;
    printf("\n%d\t%f",j.id,j.m);
  }
  
  
  //1.c
  
  #include&lt;stdio.h&gt;
  struct k
  {
    int id;
    float m;
  }j;
  
  int c;
  void fun1()
  {
    int a=0,b=5;
    printf("tis is fun1");
    printf("\n%d%d\n",a,b);
  }
  
  
  //2.c--
  
  #include&lt;stdio.h&gt;
  struct k
  {
    int id;
    float m;
  }j;
  
  void fun2()
  {
    int a=10,b=4;
    printf("this is fun2()");
    printf("\n%d%d\n",a,b);
  }
  </code></pre>
  
  <p>I compiled this code by using <code>cc a.c 1.c 2.c</code>
  but I am getting error as <code>storage size of ‘j’ isn’t known</code></p>