LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 09-03-2005, 11:08 PM   #1
true_atlantis
Member
 
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Rep: Reputation: 30
c++ generic list class?


is there some sort of generic list class that i can include in c++? i just need to be able to add things, and know the size. if so, can somone give me a link to the different method calls it has. thanks
 
Old 09-03-2005, 11:17 PM   #2
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
The STL has "vector" (dynamic array), "deque", "list" (doubly-linked list), "set", and many other such templated classes (i.e. you must use list<sometype>). Which one to use depends on things like what time-complexity you need for specific tasks (e.g. "deque" has random-access but is hard to insert in the middle; whereas it's easy to insert in the middle in "list" but has no random access). Remember to "use namespace std" in the beginning to make them work.

Here is some general reference on the STL classes:
http://cppreference.com/cppstl.html
For a much more technical reference see:
http://www.sgi.com/tech/stl/table_of_contents.html

Last edited by spooon; 09-03-2005 at 11:21 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Implementing a vector class from a list class purefan Programming 9 04-14-2005 11:48 PM
c++ list class, type of node? exodist Programming 2 05-20-2004 07:27 PM
BlackBox.class & VerifierBug.class virus ??? dalek Linux - Security 4 02-29-2004 09:55 AM
Inheriting class members (Qt C++, QApplication class) jtshaw Programming 2 01-15-2004 12:52 PM
c++ : regarding (inheritence)base class and derived class edreddy Programming 6 07-31-2002 07:33 PM


All times are GMT -5. The time now is 08:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration