Skip to content

Instantly share code, notes, and snippets.

@paosidufygthrj
Last active August 29, 2015 14:26
Show Gist options
  • Save paosidufygthrj/ffac1acae02fe47e8b27 to your computer and use it in GitHub Desktop.
Save paosidufygthrj/ffac1acae02fe47e8b27 to your computer and use it in GitHub Desktop.
[C++]std::istream の残りの文字列から std::string を作成
#include <iostream>
#include <sstream>
using namespace std;
int main() {
istringstream is("01234");
is.ignore(3);
istreambuf_iterator<char> begin(is);
istreambuf_iterator<char> end;
cout << string(begin, end) << endl; // "34"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment