Problem With Pointer

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
 
R

Richard Heathfield

(e-mail address removed) said:
Hi folks
I am having a simple problem. But I couldn't any solution.
The code is below:
typedef struct logintList
^^^^^^^^^^
Observe the spelling, and especially count the 't's.
{

struct sockaddr_in clientAddr;

char loginName[20];

struct loginList * nextClient;
^^^^^^^^^
Observe the spelling, and especially count the 't's.
 
A

aqazi

Richard said:
(e-mail address removed) said:
Hi folks
I am having a simple problem. But I couldn't any solution.
The code is below:
typedef struct logintList
^^^^^^^^^^
Observe the spelling, and especially count the 't's.
{

struct sockaddr_in clientAddr;

char loginName[20];

struct loginList * nextClient;
^^^^^^^^^
Observe the spelling, and especially count the 't's. Thanks a lot
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)

qazi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top