![]() |
| | #1 |
| 30 Helens Agree Join Date: Jan 2002
Posts: 607
| Linked Lists
__________________ AIM: Neandrake EMAIL: nta0 @ yahoo . com Operating System: Windows XP SP2 Compiler: GCC IDE: Notepad++ Don't give up your freedom to think - www.cognitiveliberty.org |
| neandrake is offline | |
| | #2 |
| Registered User Join Date: Sep 2003
Posts: 25
| Why not use the vector std class? And whatīs a RPN calculator? |
| pheer is offline | |
| | #3 | |
| 'AlHamdulillah Join Date: Feb 2003
Posts: 790
| Quote:
| |
| EvBladeRunnervE is offline | |
| | #4 |
| Registered User Join Date: Nov 2001
Posts: 38
| |
| Rutabega is offline | |
| | #5 | |
| 30 Helens Agree Join Date: Jan 2002
Posts: 607
| Quote:
__________________ AIM: Neandrake EMAIL: nta0 @ yahoo . com Operating System: Windows XP SP2 Compiler: GCC IDE: Notepad++ Don't give up your freedom to think - www.cognitiveliberty.org | |
| neandrake is offline | |
| | #6 |
| Registered User Join Date: Sep 2003
Posts: 25
| Well, itīs an vector class ![]() Itīs kind of like a linked list, but easier to use, has more functions and is more failsafe since itīs a standard class coming with all iso compilers. Hereīs an example: Code: #include <iostream>
#include <vector>
using namespace std;
void main()
{
vector<int> myvector;
int a = 5;
// Add two numbers to myvector
myvector.push_back( a );
myvector.push_back( a+1 );
// Print all item in myvector
for (int i=0; i < myvector.size(); i++)
cout << myvector[i] << endl;
// Delete the first item in myvector
myvector.erase( &myvector.at(0) );
// Delete all items
myvector.clear();
}
|
| pheer is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Singly Linked Lists: Clarification Needed | jedispy | C++ Programming | 4 | 12-14-2006 05:30 PM |
| Linked Lists 101 | The Brain | C++ Programming | 5 | 07-24-2004 04:32 PM |
| Map file formats and linked lists | Spitball | Game Programming | 2 | 03-04-2004 11:32 PM |
| need help w/ linked lists | MKashlev | C++ Programming | 11 | 08-05-2002 08:57 PM |
| doubly linked lists | qwertiop | C++ Programming | 3 | 10-03-2001 06:25 PM |