If I got a string and I would like to chop of the first 5 characters and store these in a string of their own. How would I do that?
This is a discussion on String, from - to. within the C++ Programming forums, part of the General Programming Boards category; If I got a string and I would like to chop of the first 5 characters and store these in ...
If I got a string and I would like to chop of the first 5 characters and store these in a string of their own. How would I do that?
Take a look at the substr() member function of std::string.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
Btw. if I include cctype do I then also need to declare it like "using ..........." Like in "using namespace std;"? Or is this not needed?
Everything in <cctype> is in the std:: namespace.