Created
March 7, 2017 02:20
-
-
Save KentaYamada/8f33d358856938a5676cc9dda14e32a5 to your computer and use it in GitHub Desktop.
stringデータをstdを使ってコピー
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <iostream> | |
#include <string> | |
int main() | |
{ | |
std::string text = "abcde"; | |
std::string copy_text = ""; | |
std::copy(text.begin(), text.begin()+3, std::inserter(copy_text, copy_text.begin())); | |
std::cout << copy_text << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment