Split string from a character array?

Hello!
Help to realize the following thing:
1. User-entered numbers, such as 1 3 50
2. Need to i[0] = 1, i[1] = 3, i[2] = 50,

How to implement this in c++?
June 10th 19 at 15:29
1 answer
June 10th 19 at 15:31
// read the line
std::string s;
std::getline(std::cin, s);
// ...and parse it slowly through the stream-line
std::istringstream is(s);
int i;
std::vector<int> v;
while (is >> i)
 v.push_back(i);</int>

Find more questions by tags C++