C Board  

Go Back   C Board > General Programming Boards > Networking/Device Communication

Reply
 
LinkBack Thread Tools Display Modes
Old 11-18-2003, 09:36 PM   #1
30 Helens Agree
 
neandrake's Avatar
 
Join Date: Jan 2002
Posts: 607
Linked Lists

I have a working class for asynchronous sockets. To handle users, I was thinking of making linked lists to go through connected users, instead of an array of users. I wrote an RPN calculator before using linked lists, but I'm still a little confused as to how to make this work. Do I just give each class unit an id value?
__________________

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   Reply With Quote
Old 12-08-2003, 01:27 PM   #2
Registered User
 
pheer's Avatar
 
Join Date: Sep 2003
Posts: 25
Why not use the vector std class? And whatīs a RPN calculator?
pheer is offline   Reply With Quote
Old 12-08-2003, 01:37 PM   #3
'AlHamdulillah
 
Join Date: Feb 2003
Posts: 790
Quote:
whatīs a RPN calculator?
Reverse Polish Notation. e.g. instead of 8+8, its 8 8 +
EvBladeRunnervE is offline   Reply With Quote
Old 12-09-2003, 02:20 PM   #4
Registered User
 
Join Date: Nov 2001
Posts: 38
RPN calculators:

www.hpcalc.org
Rutabega is offline   Reply With Quote
Old 12-12-2003, 02:45 AM   #5
30 Helens Agree
 
neandrake's Avatar
 
Join Date: Jan 2002
Posts: 607
Quote:
Originally posted by pheer
Why not use the vector std class? And whatīs a RPN calculator?
never used it, what is it?
__________________

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   Reply With Quote
Old 12-12-2003, 04:17 AM   #6
Registered User
 
pheer's Avatar
 
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();
}
http://www.cppreference.com/cppvector.html
pheer is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 04:41 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22