A
aqazi
Hi folks
I am having a simple problem. But I couldn't any solution.
The code is below:
typedef struct logintList
{
struct sockaddr_in clientAddr;
char loginName[20];
struct loginList * nextClient;
}client;
Now I am using a glo0bal variable.
client *clientPtr;
In main function I am doing malloc.
clientPtr = malloc(sizeof(client));
I am using this in thread created by main function.
LIke this
1 if(strcmp(clientPtr->nextClient->loginName, loginName) == 0)
2 {
3 localTempClient = clientPtr->nextClient;
4 localTempClient->nextClient = NULL;
5 clientPtr->nextClient = clientPtr->nextClient->nextCLient;
6 free(localTempClient);
7 }
it giving me the following error:
chatServ.c:3: warning: assignment from incompatible pointer type
chatServ.c:1: error: dereferencing pointer to incomplete type
I am trying to figure out whats wrong but still no luck.
Can any one give some idea??
Thanks
qazi
I am having a simple problem. But I couldn't any solution.
The code is below:
typedef struct logintList
{
struct sockaddr_in clientAddr;
char loginName[20];
struct loginList * nextClient;
}client;
Now I am using a glo0bal variable.
client *clientPtr;
In main function I am doing malloc.
clientPtr = malloc(sizeof(client));
I am using this in thread created by main function.
LIke this
1 if(strcmp(clientPtr->nextClient->loginName, loginName) == 0)
2 {
3 localTempClient = clientPtr->nextClient;
4 localTempClient->nextClient = NULL;
5 clientPtr->nextClient = clientPtr->nextClient->nextCLient;
6 free(localTempClient);
7 }
it giving me the following error:
chatServ.c:3: warning: assignment from incompatible pointer type
chatServ.c:1: error: dereferencing pointer to incomplete type
I am trying to figure out whats wrong but still no luck.
Can any one give some idea??
Thanks
qazi