Jump to content

  • Log In with Google      Sign In   
  • Create Account

Dynamic Array class


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Chmod007   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 September 1999 - 06:14 AM

I am in great needs of a good array class. I need features like sorting, moving and removing elements.

Any ideas. is STL a good choice? where can I find it?


Sponsor:

#2 Arfa   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 September 1999 - 10:48 AM

STL is great for what you want to do. Not sure how fast it is but I don't think it'd be any slower than if you did it yourself.

The STL library should be included with your C++ package. It comes with g++ (including DJGPP) at least.

Try and search for the C++ Annotations document. This explains the STL classes in some detail. I can't remember where it can be found, but no doubt someone will know where to find it.


------------------
=> Arfa <=


#3 Chmod007   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 September 1999 - 10:29 PM

I can't find a fuction in vector to aid in moving objects. i want to be able to move an element from any pos to the first pos. any ideas on how this might be done?

#4 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 17 September 1999 - 06:14 AM

If you want to be STL conform you have to use
template
std::swap( T& iter1, T& iter2 );
with iterator referencing the positions
(so you could use pointers in a vector,
but better is using iterators at the positions)
Refer to your documentation or buy a good book on STL for better understanding of iterators




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS