I'm taking in input from the user as a string. I want to transfer the input to an integer array. I'm using atoi
, but it places the entire input from the user into each part of the integer array. How do I get this to happen:
string input = 12345
array[0] = 1
array[1] = 2
array[2] = 3
etc.
Instead of:
string input = 12345
array[0] = 12345
array[1] = 12345
array[2] = 12345
etc.