Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // string::copy
- #include <iostream>
- #include <string>
- int main ()
- {
- char buffer[20];
- std::string str ("Test string...");
- //string.copy(char*, length, begin);
- std::size_t length = str.copy(buffer,6,5);
- buffer[length]='\0';
- std::cout << "buffer contains: " << buffer << '\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment