如何更新C

时间:2018-03-11 05:26:35

标签: c arrays pointers struct

我有一个函数recvErrorCheck(这只是它的一小部分)我希望更新socketStruct我传入它。我了解如何更新intfd_set,但我感到困惑,因为socketStructsocketInfo(*)[500]

void recvErrorCheck(int result, int j, int k, fd_set *readfds, int* observerVisits, 
                    int* participantVisits, struct socketInfo* socketStruct){
   if (result == 0){
   printf("socket closed\n");
   FD_CLR(j, readfds);
   close(j);

   if(socketStruct[k]->type == 'O'){
    *observerVisits--;
   }
   if(socketStruct[k]->type == 'P'){
     *participantVisits--;
   }
然后我打电话给

recvErrorCheck(result, j, k, &readfds, &observerVisits, &participantVisits,
               &socketStruct);

截至目前,但这对socketStruct无效。

谢谢!

0 个答案:

没有答案