title: what is the cause of this error: Structure required on left side of . or .*?
body: <pre><code>typedef struct tsk{
      int x;
      int n;
  }TSK;
  
  TSK trd[MAX];
   main(){
      while(life!=0){
   randomize();
       for(i=0;i&lt;MAX;i++){
       trd[i].n=rand()%40+10;
           if(trd[i].n&lt;10||trd[i].n&gt;45)
           trd[i].n=rand()%40+10;
           trd[i].x=25;
       }
       for(m=0;m&lt;MAX;m++){
       gotoxy(8,m);printf("%c%c",23,23);
       gotoxy(7,m);printf("%c",17);
       gotoxy(46,m);printf("%c%c",23,23);
       gotoxy(48,m);printf("%c",16);
       }
   for(j=0;j&lt;MAX;j++){
   if(life==0)
       break;
   gotoxy(1,1);
   insline();
   gotoxy(trd[j].n,1);
   printf("%c",3);
   trd[j].x--;
   gotoxy(ply,25);
   printf("%c",1);
   gotoxy(1,26);
   delline();
   score++;
   life=hit(trd,life,ply);
   gotoxy(57,25);
   printf("SCORE: %0.0f  LIFE: %d",score,life);
   gotoxy(8,1);printf("%c%c",23,23);
      gotoxy(46,1);printf("%c%c",23,23);
      gotoxy(7,1);printf("%c",17);
      gotoxy(48,1);printf("%c",16);
      gotoxy(4,1);printf("%c",label[j]);
      delay(200);
  
          if(kbhit()){
              key=getch();
              key=toupper(key);
              if(key==27)
                  life=0;
              if(key=='L')
              ply++;
                  if(ply==46)
                  ply--;
              else if(key=='K')
              ply--;
                  if(ply==9)
                  ply++;
              }
     }
    }
  }
  
  int hit(int trd[],int life, int ply){
  int i;
      for(i=0;i&lt;MAX;i++){
          if((trd[i].n==ply)&amp;&amp;(trd[i].x==0))
              life-=1;
          }
      return life;
  
  
    }
  </code></pre>
  
  <p>Can anyone help me how to correct this error: Structure required on left side of . or .*? when i run the program, it gives me this error and it is pointing to hit() function. i can't find what causes this error.pls help.thanks.</p>