Archived

This topic is now archived and is closed to further replies.

johnnyBravo

what other c++ string types are there apart from char?

Recommended Posts

johnnyBravo    100
instead of using an array of char variables, what other ways of storing strings are there, like i remember a tutorial somewhere using something else apart from char but i cant remember what it was...

Share this post


Link to post
Share on other sites
xsketchyx    122
std::string from the STL (standard template library).

Official STL page: http://www.sgi.com/tech/stl/

For more references just google "Standard Template Library" or "STL".

There are also several books available that are pretty good, but I can''t recommend any personally as I haven''t read them. Check ratings at amazon.com...

Share this post


Link to post
Share on other sites
DarkSlayer    100
What is your intensions? Do you want to handle "strings"? performe algoritms to a line of text, and are seeking other ways to do it, than using an array?

..or are you looking for other datatypes than char?

well, I can''t tink of something better than the use of array, whithout bringing up some advanced stuff, but I guess STL have some stuff to handle strings better than a simple array.

When it comes to different datatypes, then you have alot more to choose from. since char is only 8bit, and only ascii friendly, you could look towards the use of unicode when handling text in your programs. belive you have wchar_t or something like that, don''t remember. But you have some datatypes that alow you to handle old ascii type char text, and the new unicode text standard...

Share this post


Link to post
Share on other sites
Fruny    1658
quote:
Original post by xsketchyx
Official STL page: http://www.sgi.com/tech/stl/



SGI''s page is neither THE official STL page, nor is it normative : the STL as defined by the C++ standard my differ from SGI''s implementation.


[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]

Share this post


Link to post
Share on other sites
Sneftel    1788
quote:
Original post by Fruny
SGI''s page is neither THE official STL page, nor is it normative : the STL as defined by the C++ standard my differ from SGI''s implementation.

True. But SGI goes to great pains to mention deviances from the STL standard, and it''s the most readable and useful reference I''ve seen so far.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites