I have a integer number say 1234.I want to store it digit by digit in a vector. So i wrote the following
vector<int>arr;
int c;
while(cin>>c)
{
arr.push_back(c);
}
But this is taking 1234
as a whole an passing onto the vector.I don't want to use gets()
and all the other functions which scan the digit as a character.So is there any way to do it?