Jump to content
  • Advertisement
Sign in to follow this  
PPCThug

what is std::string?

This topic is 4852 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I assume this is the right forum for this kind of question. I was asking about strings in the programming forum and they recomended std::string. after they mentioned that I got the distinct and unpleasent feeling I should know what it is, so I searched the forum for std::string and couldn't find any answers. and now that I just glanced through the appendix to my c++ book and ran accross somthing called standard template library... any relation? it only gives a paragraph on it.

Share this post


Link to post
Share on other sites
Advertisement
std::string is not technically part of the standard template library, but it is part of the C++ standard library (of which the STL is also a part of). If your C++ book does not mention std::string, then I strongly suggest you put it down and get another one. Otherwise your compiler documentation may have details on the std::string class (or std::basic_string).

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCraneIf your C++ book does not mention std::string, then I strongly suggest you put it down and get another one.

Spot on there! Although, its could be a Microsoft book, in which case it could be recommending the use of CString instead, but I wouldn't recommend lacing your code with dirty MFC for the sake of a string class when std::string are available.

Share this post


Link to post
Share on other sites
its sams teach your self c in 21 days 4th edition, and sams teach your self c++ in 24 hours third edition actually. I'll consider getting a different c book as soon as I have some spare cash. thanks for the info

Share this post


Link to post
Share on other sites
Quote:
Original post by PPCThug
its sams teach your self c in 21 days 4th edition, and sams teach your self c++ in 24 hours third edition actually. I'll consider getting a different c book as soon as I have some spare cash. thanks for the info

Anything on "c" and not "c++" won't have anything about string classes as there no such thing as a class in "c". If you want to be able to get information on std::string then you will need to get a "c++" book, I'm surprised the teach yourself c++ does have anything about std::string.

Share this post


Link to post
Share on other sites
Having said all of that, you don't really need a book to learn C++, it's just handy.

Doing a quick google for "std::string" I found these:
C++ String
ANSI String Class

If you are looking for a good C++ reference book, you can't go past Herbert Schildt's C++: The Complete Reference. It has C, C++ and the Standard Template Library. (Please note, it's a reference book, not a step by step tutorial or anything)

Share this post


Link to post
Share on other sites
I have heard good things about "Accelerated C++", it teaches C++ as a standalone language, which is how it should be taught. C++ can be used as a better version of C, but it can be so much more.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!