title: invalid type argument of unary ‘*’ (have ‘int’)
body: <pre><code>struct Apartment {
      int floor;      // aparment's floor
  };
  
  void main() {
      Apartment apartments[10];// array containing all the apartments
  
      create_apartments(apartments);
  };
  
  void create_apartments(struct Apartment *apartments) {
     int i,pos;
  
     pos=0;
     for(i=0;i&lt;10;i++){
         *(apartments+pos)-&gt;floor = i;  //error apears here!
          pos++;            
      }
  }
  </code></pre>
  
  <p>invalid type argument of unary ‘*’ (have ‘int’) appears at commented line. can someone tell me what's wrong? thanks :)</p>