C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 06-08-2003, 07:10 PM   #1
Registered User
 
Join Date: Jun 2003
Posts: 147
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()?
__________________
Only by the cross are you saved...
fkheng is offline   Reply With Quote
Old 06-08-2003, 09:40 PM   #2
Just Lurking
 
Dave_Sinkula's Avatar
 
Join Date: Oct 2002
Posts: 4,990
>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
__________________
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Dave_Sinkula is offline   Reply With Quote
Old 06-09-2003, 03:39 AM   #3
....
 
Join Date: Aug 2001
Location: Groningen (NL)
Posts: 2,386
Here's a C reference:
http://www.acm.uiuc.edu/webmonkeys/book/c_guide/
Shiro is offline   Reply With Quote
Old 06-10-2003, 05:41 AM   #4
Registered User
 
Join Date: Jun 2003
Posts: 147
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
__________________
Only by the cross are you saved...
fkheng is offline   Reply With Quote
Old 06-10-2003, 07:26 AM   #5
C++ Developer
 
XSquared's Avatar
 
Join Date: Jun 2002
Location: UWaterloo
Posts: 2,718
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.
__________________
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
XSquared is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Doubly linked lists mohanlon C Programming 7 06-27-2009 07:45 PM
Linked Lists wvu2005 C Programming 12 10-06-2005 11:36 AM
Linked Lists 101 The Brain C++ Programming 5 07-24-2004 04:32 PM
eof in fstream & singly linked lists mazo C++ Programming 3 06-03-2002 09:50 AM
Linked lists and file i/o, and some other stuff ninja C++ Programming 9 05-19-2002 07:15 PM


All times are GMT -6. The time now is 04:41 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22