[ create a new paste ] login | about

Link: http://codepad.org/lBtzCZ1A    [ raw code | output | fork ]

C++, pasted on Nov 19:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include<sstream>
using namespace std;

int main() {
    stringstream stream("-1");
    unsigned int x=0;
    stream>>x;
    if(stream)
        cout<<x;
    else
        cout<<"error";
    return 0;
}


Output:
1
error


Create a new paste based on this one


Comments: