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

Started by
4 comments, last by johnnyBravo 20 years, 6 months ago
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...
Advertisement
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...
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...

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 ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
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.
Fair enough.

[ 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 ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

This topic is closed to new replies.

Advertisement