Wednesday, 15 June 2011

c++ - reading array format input -



c++ - reading array format input -

can you, please, help input of format:

{1,2,3,4}

and convert array integers?

int * ns = new int [n]; cin >> ns;

this not work. how should alter it?

using namespace std; typedef istream_iterator<int> it; vector<int> v; copy(it(cin), it(), back_inserter(v));

c++ arrays input

No comments:

Post a Comment