title: Declare struct in header file
body: <p>I want to declare a structure in a header file so I can use it in my source file. What am I doing wrong? I want to be able to access my struct from any function.</p>
  
  <p>info.h</p>
  
  <pre><code>#ifndef INFO_H
  #define INFO_H
  
  typedef struct info
  {
     int mem_size;
     int start_loc;
     int used_space;
     int free_space;
  } INFO;
  #endif
  </code></pre>
  
  <p>test.c</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;info.h&gt;
  
  #define F_first 1
  #define F_last 2
  #define F_data_int 3
  #define F_data_char 4
  #define F_data_float 5
  #define F_print 6
  
  void * f(int code);
  
  int main() {
  
  INFO in;
  in.mem_size = 8;
  f(F_last, 0,0);
  return(0);
  }
  
  void * f(int code) {
  printf("%d", in.mem_size);
  }
  </code></pre>