QUOTE(PennyBoki @ 30 Oct, 2007 - 07:24 AM)

Also you need to know how big the list should be so that you can allocate memory using the malloc() function, then do the inputs.
NOOOOOOOO!

Sorry, two things.
First, the entire point of a linked list is that it can be arbitrary in length. You allocate space to the nodes, not the list. You add to the list by creating a node making that node one of the links in the list. In it's simplest form, you point the new node at the top and then make it the top.
Second, malloc is a bad and evil thing, even in C++, and should be avoided at all costs. Even when using a struct in C++, you should be able to allocate and deallocate using
new and
delete.
Seriously, the example code doesn't really show an understanding of the concept. If you want the Internet to do your homework,
ask Google. I got about 1.5 million hits, some must have the answer.