Skip to content

Instantly share code, notes, and snippets.

@aqjune
Created Apr 27, 2021
Embed
What would you like to do?
tellg.cpp
#include<iostream>
#include<sstream>
using namespace std;
int main() {
stringstream ss;
ss << "aa\nbb\n";
string str1;
getline(ss, str1);
cout << "str(): " << ss.str() << endl;
cout << "str().substr(tellg()): " << ss.str().substr(ss.tellg()) << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment