![]() |
|
#1
|
|||
|
|||
Insert problem in Linked listI have a problem in inserting items in linked list. Hence, there are different way to insert the items to the list. The first one is loading data form a txt file(1). And the second one is input from keyboard. I have done the first part. I have got a question in second part. Do I need to continue the insertion by using the (1) linked list and its position ? If yes, how to return the ptr and list position ?
Can I do sth like this ? If yes, what type I should use. If no, how can I insert other new items in the same list by using keyboard ? type ReturnPtr( List * l, Position p){ return l, p; } |
|||
|
#2
|
|||
|
|||
|
Quote:
Hi, I wrote similar function a few days back.Parden me if its not what you are actually looking for.I am no expert in C.never the less the function works for me. I am assuming you already have some data in your linked list cause thats what my functions assume too :-).I have a check before calling the actual function to see if list contains data.I.e.Head Pointer is not NULL. So here is my function CPP / C++ / C Code:
|
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Merge sort on a linked list | Temujin_12 | C++ Forum | 1 | 06-Mar-2008 20:33 |
| Question about linked list and queue | Kay Chan | C++ Forum | 7 | 02-Sep-2004 09:27 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 15:13 |
| help on linked lists any1????? | nick4 | C Programming Language | 1 | 17-May-2004 09:32 |
| [include] list1.h -- Linked list class | dsmith | C Programming Language | 2 | 04-May-2004 09:42 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The