i got this code
http://img66.imageshack.us/my.php?image=93367399de7.gif
i know linked lists a little
but in this code there are some arrows i cant understand
what is their meaning??
is there any tutorial for these arrows thing?
i got this code
http://img66.imageshack.us/my.php?image=93367399de7.gif
i know linked lists a little
but in this code there are some arrows i cant understand
what is their meaning??
is there any tutorial for these arrows thing?
Assuming by 'arrows' you mean this ->.
p->x = (*p).x
yes you are correct
where can i read about them?
Not much to read about. When you have a pointer to a struct you can access its elements by using a -> instead of a . It is just easier notation instead of having to dereference the pointer, and then access its elements by using the * operator. (keep in mind that this is what you are doing by using the -> though anyways, it is just shorthand notation).
(*ObjName).Element == ObjName->Element
i found that they are a part of the struct subject
so they have nothing to do with linked list
where can i find a good tutorial on linked lists and
binary trees?
google.com
I found about 100 of them by typing
linked list tutorial in C
binary tree tutorial in C
why in the start of this code they write this line:
typedef struct node node;
when we are doing typedef command like
typedef struct A B;
we get that B is the same data type as A
so why write to identical names?
You don't get that B is the same data type as A. You can't get anything to be the same data type as A, since A is not a data type. B is the same data type as "struct A".
in this thread
http://cboard.cprogramming.com/showthread.php?t=108486
where is my mistake in understanding these words?
because in this case i was told that Album and album
are the same data type
aaahhhh
Album=struct album
thanks
so why are they saing that node=struct node ?
i know that a node must consists of a variable with same type
after that line they building struct in that way
but why adding this typedef line above the struct command
??Code:typedef struct node node;
So then the typedef allows you to say "node" when before you had to say "struct node". It's just an alias.
ok i understand
thanks