difference between cstring and string

hello! i was just wondering what the difference is between cstring and string. i surfed the web and book for answers, but none really make sense.. also when would i use one over the other.

thanks!
Well, <cstring> is basically a header containing a set of functions for dealing with C-style strings (char*). <string>, on the other hand, is header that allows you to use C++-style strings (std::string), which can do a lot of if not all of the functions provided in <cstring> on their own.

-Albatross
Use string. cstring is so 1970's. string is a modern way to represent strings in c++. you'll need to learn cstring because you will run into code that uses it. but cstring is responsible for lots of unsafe code.
Topic archived. No new replies allowed.