-
Linked Lists & Pointers
I am currently reading a tutorial so that I can do a homework assignment my lecturer gave me based on pointers, structures and for a single linked list.
I have to implement these concepts intot hte homework, whereby I have to accept data (about a student's profile, like name, age, and such...) and then print them out.
I have created structures for the profile details. For example, last name and first name come under the Struct Name and so forth.
However, I really need ideas on how to achieve utilising pointers. Can someone give me fresh new ideas?
Also, I have been reading a tutorial on single linked list, and happened to come across some keywords I'm not famliar with.
What is assert( ) for? Also, what is this variable type for ( i keep seeing it ) "size_t ? What is memcpy()?
-
>What is assert( ) for?
http://www.embedded.com/story/OEG20010311S0021
http://www.embedded.com/story/OEG20010416S0090
>Also, what is this variable type for ( i keep seeing it ) "size_t ?
It "is the unsigned integer type of the result of the sizeof operator".
>What is memcpy()?
memcpy
-
-
ok, hm......wat is the difference between these 2 then?
assert(Item != NULL) and if (NULL == *Item) ?
Assuming Item is a pointer variable for a struct
-
Item != NULL is true if Item is pointing to a memory location.
NULL == *Item is true if the data pointed to by Item is NULL.