| | |
how do i label a linked list?
![]() |
•
•
Join Date: Nov 2006
Posts: 224
Reputation:
Solved Threads: 31
Hi, I have a linked list which I created in a function? I want to allow the user to enter a name for the linked list, and then after he/she can display the list by typing in the title. This is part of my code
C Syntax (Toggle Plain Text)
struct llistt{ char str[100]; // where the strings will be kept struct llistt *next struct llistt *prev } typedef struct llistt node
--
Index of mp3
Index of mp3
Right now your list consists only of nodes. If you want data that applies to the list as a whole, you should create a new structure that contains a list as well as that data:
Then you use it the same way, just instead of arbitrary pointers for the head of the list, you store it in a list object.
c Syntax (Toggle Plain Text)
struct node { char str[100]; // where the strings will be kept struct node *next struct node *prev }; struct list { char name[100]; struct node *head; }; typedef struct node node; typedef struct list list;
I'm here to prove you wrong.
![]() |
Similar Threads
- Doubly Linked List Problem - Help! (C)
- Finding path in a graph using linked list (C)
- Help with binary search tree insertion (C++)
- Source Code that don't work? (Java)
- Seg Fault ~ Linked List Delete (C)
Other Threads in the C Forum
- Previous Thread: Int To String
- Next Thread: Ordering arrays?
| Thread Tools | Search this Thread |
* ansi api array arrays bash binarysearch calculate centimeter changingto char character convert copyanyfile copypdffile createcopyoffile createprocess() directory dynamic execv fflush file floatingpointvalidation fork forloop frequency function getlasterror getlogicaldrivestrin givemetehcodez grade graphics gtkgcurlcompiling gtkwinlinux hardware highest histogram homework i/o ide inches infiniteloop initialization input intmain() iso keyboard km license linked linkedlist linux list looping loopinsideloop. lowest matrix microsoft mysql oddnumber open opendocumentformat openwebfoundation pdf pointer pointers posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send shape single socketprogramming stack standard strchr string suggestions test testautomation threads unix urboc user variable whythiscodecausesegmentationfault win32api windows.h windowsapi






