Next: Destructors
Up: C++/C
Previous: Memory allocation
- The C++ string class is very useful. Strings can be concatenated using
the '+' operator. Other manipulations with strings tend to be similarly
intuitive. Make sure to include the header file:
#include <string>
- You often need to convert C++ strings to char *
For example for use with ifstream, you need to do the following:
string filename="tmp.txt";
ifstream infile (filename.c_str(),ios::in);
- Web site with string info:
Chris Paciorek
2006-04-02