Pavel
unread,Jan 18, 2015, 8:34:53 PM1/18/15You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Should the code below print 1 or -1? I think -1, but the standard library
implementations I tried printed 1; who is right and why?
Thanks in advance,
-Pavel
#include <iostream>
#include <sstream>
using namespace std;
int main(int, char*[]) {
const string s(1, 'A');
istringstream iss(s);
char c;
iss >> c;
cout << iss.rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in) << endl;
return 0;
}