| | |
Linked List & Objects
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Well as now one answered this ill just add the comment I had in mind when I first saw the post... in c++ structs are just classes with default access right of public, as opposed to private, so any code that can handle structs can handle objects...
however if this was a question about an object oriented solution to the linked list problem I guess that does not help much ? if you are new to c++ perhaps the list of the stl can be of intrest.
however if this was a question about an object oriented solution to the linked list problem I guess that does not help much ? if you are new to c++ perhaps the list of the stl can be of intrest.
•
•
•
•
Originally Posted by Dinkum C++ on list
The template class describes an object that controls a varying-length sequence of elements of type Ty. The sequence is stored as a bidirectional linked list of elements, each containing a member of type Ty.
/pern.*/i
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. Albert Einstein
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. Albert Einstein
•
•
Join Date: Jul 2005
Posts: 1,671
Reputation:
Solved Threads: 261
I find it useful to think of a list as a sequence of objects, frequently called links or nodes, linked by pointers. The link/nodes can be instances of a struct/class which in turn contain both a data object and at least one pointer. In C you can only use structs to do this, as the concept of class isn't available. In C++ a struct and a class are the same thing, except that struct members default to public access and class members default to public.
![]() |
Similar Threads
- Removing an item from head of linked list (C)
- Checking for duplicates in a orderedered linked list (C++)
- Cannot figure out how to implement linked list and rbtree for a project! (Java)
- Linked List (C++)
- help by sorting a simply linked list (C)
Other Threads in the C++ Forum
- Previous Thread: Searching a file for a string
- Next Thread: please check my code and help me
| Thread Tools | Search this Thread |
api array based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






