title: How to access array of structure in another file
body: <p>How to access array of structure in another file.lets say i have 3 file  1.h 2.cpp 3.cpp as below</p>
  
  <p>1.h</p>
  
  <pre><code>    #include&lt;stdio.h&gt;
      struct st
    {
         Int i;
          char ch[10];
  
      };
     struct st var[10];
  </code></pre>
  
  <p>2.cpp</p>
  
  <pre><code>   #include"1.h"
       int main
       {
          int s;
         //here i hve scannd value of i frm user
         callotherfile();
        }
  </code></pre>
  
  <p>i
  3.cpp</p>
  
  <pre><code>    #include"1.h
       int p;
         void callotherfile(void)
        { 
          for(p=1;p&lt;=10;p++)
         cout&lt;&lt;var.i[p]&lt;&lt;end;// is it good can i excess?
        }
  </code></pre>
  
  <p>here i am getting errir as  p and s are non of class type please help me to fix it</p>
  
  <p>i am compiling as g++ 2.cpp 3.cpp</p>