string class (C++)
I was wondering what "managed" string classes are generally being used by C++ programmers. Right now I'm using a homemade one, but I figured there are probably much better ones out there. I need one that works at least on windows, linux and mac.
std::string (I assume by "managed" you don't mean anything that has got to do with managed code)
In the standard library there is a string class.
example
There is lots of nice stuff beside the string class in the c++ standard library. Like managed dynamic arrays<vector>, linked list <list>. It's worth checking out.
example
#include <string>using namespace std;string first_name = "Bjarne";string last_name;last_name = "Stroustrup";string names = first_name + " " + last_name;cout << names << endl;names = last_name + ", " + first_name;cout << names << endl;
There is lots of nice stuff beside the string class in the c++ standard library. Like managed dynamic arrays<vector>, linked list <list>. It's worth checking out.
Standard C++ contains std::string. You can use it by including <string>.
There are more of these precious jewels: dynamic arrays, linked lists, sorting algorithms. See for example cppreference.com and a gazillion other sites. These things make your life better [wink].
There are more of these precious jewels: dynamic arrays, linked lists, sorting algorithms. See for example cppreference.com and a gazillion other sites. These things make your life better [wink].
ok thanks std::string it will be then.
I really should use the standard C++ librabry more often, it would probably save me alot of time :)
I really should use the standard C++ librabry more often, it would probably save me alot of time :)
Quote:Original post by ronkfist
ok thanks std::string it will be then.
I really should use the standard C++ librabry more often, it would probably save me alot of time :)
That, and it would prevent having various gamedevers yelling 'std::string' at you. That'd sound just weird being pronounced at all, let alone yelled.
Quote:Original post by joanusdmentia
That, and it would prevent having various gamedevers yelling 'std::string' at you. That'd sound just weird being pronounced at all, let alone yelled.
I pronounce it "standard string." Hardly weird.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement