I want to copy a string without the first four characters. It doesn't matter weather or not it's c or c++ style strings.
This is a discussion on copy string not from beginning within the C++ Programming forums, part of the General Programming Boards category; I want to copy a string without the first four characters. It doesn't matter weather or not it's c or ...
I want to copy a string without the first four characters. It doesn't matter weather or not it's c or c++ style strings.
Code://For std::string std::copy(str.begin()+4,str.end(),copytoItr); //for c-string std::copy(str+4,str+STR_LEN,copytoItr);
It is too clear and so it is hard to see.
A dunce once searched for fire with a lighted lantern.
Had he known what fire was,
He could have cooked his rice much sooner.
Code:std::string oldstring("Hey there!"); std::string newstring(oldstring.substr(4)); // newstring = "there!"
I used to be an adventurer like you... then I took an arrow to the knee.