Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Problem With Pointer

Reply
Thread Tools

Problem With Pointer

 
 
aqazi@inbox.com
Guest
Posts: n/a
 
      09-08-2006
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

 
Reply With Quote
 
 
 
 
Richard Heathfield
Guest
Posts: n/a
 
      09-08-2006
http://www.velocityreviews.com/forums/(E-Mail 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.

--
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)
 
Reply With Quote
 
 
 
 
aqazi@inbox.com
Guest
Posts: n/a
 
      09-08-2006

Richard Heathfield wrote:
> (E-Mail 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pointer to an array vs pointer to pointer subramanian100in@yahoo.com, India C Programming 5 09-23-2011 10:28 AM
Pointer to pointer or reference to pointer A C++ 7 07-05-2011 07:49 PM
Pointer to pointer Vs References to Pointer bansalvikrant@gmail.com C++ 4 07-02-2009 10:20 AM
passing the address of a pointer to a func that doesnt recieve a pointer-to-a-pointer jimjim C Programming 16 03-27-2006 11:03 PM
Pointer-to-pointer-to-pointer question masood.iqbal@lycos.com C Programming 10 02-04-2005 02:57 AM



Advertisments