I have the following struct:
struct clientDetails
{
int socket;
char* port;
char* IP;
char* hostName;
int msgSentCount;
int msgRecvCount;
char* status;
char bufferMsg[BUFFER_SIZE];
char blockedUser[4];
int blockedCount;
};
And I have an array of pointers:
struct clientDetails* allClients[4];
How can I initialize all the array elements of allClients to have default values?
I have tried the following but I am getting 'incomplete definition of type struct':
for(int i = 0; i<4; i++) {
allClients[i]->socket = 0;
allClients[i]->port = NULL;
allClients[i]->IP = NULL;
allClients[i]->hostName = NULL;
allCLients[i]->msgSentCount = 0;
allClients[i]->msgRecvCount = 0;
allClients[i]->status = NULL;
allClients[i]->bufferMsg = "";
allClients[i]->blockedUser = {"","","",""};
allClients[i]->blockedCount = 0;
}