How to convert 4 digit integer (eg. 4701) to a vector with 4 elements with each digit being an element? [closed]

  c++

Say I have the integer 4702, I wanna turn it into a std::vector<int> v with the elements v[0] = 4, v[1] = 7, v[2] = 0 and v[3] = 2.
How exactly would I do something like this?

Source: Windows Questions C++

LEAVE A COMMENT