title: Array Struct and array
body: <p>I wrote some code:). I don't know make it work. It work when I use array but it doesn't work when I use array of structs. In my program I use library function to take data from inside database and it look like that:</p>
  
  <pre><code>int opfGetAll( void *opf,const char *info, const char *name, void *parms )
  </code></pre>
  
  <p><code>opf</code> - pointer to db<br>
  <code>info</code> - the info type<br>
  <code>name</code> - name of parameter<br>
  <code>parm</code> - the array output, this must be of the correct type</p>
  
  <pre><code>int main()
  {
      struct data
      {
          int intVal;
          float floatVal;
          double doubleVal;
       };
  
       //struct data *iform1_tab = malloc(sizeof(struct data)*number_locs);
       float *iform1_tab = malloc(sizeof(float)*number_locs);
       if(iform1 ==2 )//FLOAT
       {
           //opfGetAll(opf,type1,attr_inp1, &amp;iform1_tab[0].floatVal);//don't take all data, it fill half of it and the rest is 0 or rubbish
           opfGetAll(opf,type1,attr_inp1, iform1_tab );//this version fill all array
  
       }
  
  
   }
  </code></pre>