[ create a new paste ] login | about

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

C++, pasted on Jul 10:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <sstream>
#include <string>
#include <iostream>

using namespace std;

int main() {
    
    string str = "1";
    istringstream iss(str);
    int one = 0;
    iss>> one;
    cout<< "one is: " << one <<endl;
    str = "2";
    istringstream anotheriss(str);
    anotheriss>> one;
    cout<< "one is: " << one <<endl;

    return 0;

}


Output:
1
2
one is: 1
one is: 2


Create a new paste based on this one


Comments: