|
STD vector question again
Hi!
Is this a proper use of a strings vector?
Thanks,
Zeblar Nagrim, Lord of Chaos
It looks ok.
Just a small tip: You don''t have to call vector::clear() since the vector will clear itself upon destruction.
Snale
+--My humble and superior homepage
Just a small tip: You don''t have to call vector::clear() since the vector will clear itself upon destruction.
Snale
+--My humble and superior homepage
Snale+--My humble and superior homepage
the code is ok, but
You should actually be using std::string. that way you don`t need to worry about memory allocation and deallocation.
This is actually very efficient, because most implementation of the stl string uses reference counted pointers, so when you push_back the string, the only thing that is copied is actually an internal pointer.
Edited by - Gorg on June 24, 2001 8:22:44 PM
You should actually be using std::string. that way you don`t need to worry about memory allocation and deallocation.
|
This is actually very efficient, because most implementation of the stl string uses reference counted pointers, so when you push_back the string, the only thing that is copied is actually an internal pointer.
Edited by - Gorg on June 24, 2001 8:22:44 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement