• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Comments on Linked List code

#1
I've had to write some Linked List code recently and I've managed to get it to compile and the test code seems to work. I was just wondering if anyone has any comments about it or can point out some glaring issues with any of it.

I am quite new to malloc and friends so I want to make sure I've not screwed anything up there.

I've attached the code with a Makefile to this post.
 

Attachments

#4
noob questions.

what does it mean when you use:

port2->index = "43";

what does the arrow mean? and why are you using 43 as a string? (inside quotes)
 
#5
port2 is a pointer so I could use (*port2).index but because this is such a common need the -> method of accessing structure members through pointers is provided.

I am using strings because its all involved with SNMP and OIDs which are easier to work with using strings
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,016
Latest member
ernestrojasn