string class (C++)

Started by
11 comments, last by Zahlman 17 years, 8 months ago
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.
Advertisement
std::string (I assume by "managed" you don't mean anything that has got to do with managed code)
std::string.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

In the standard library there is a string class.

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].
std::string
std::string.
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 :)
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.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
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