Would something like this work for breaking up a number into individual integers?

I want to take something like 5620 and turn it into an array with [5][6][2][0] as the entries. But i would also like this to be an unconstrained (no set number of entries) becaues the numbers I’m using will change. Would something like this work?

I just cut this function out of my code, but i’ll be inserting the value answer into the function.

```
int count = 0;
int numdigits;
int giraffe;
int nanswer;
answer = nanswer
if (answer < 0)
nanswer = -answer;
while(nanswer > 1)
{
numdigits++;
nanswer/=10;
}
int outArray[numdigits];
int numsaver = numdigits;
while(numdigits > 0) //this function writes the individual numbers to the array outArray
{
outArray[count] = (answer/(pow(10,(numdigits-1)); //takes the answer, divides by 10^(number of digits - 1) (which gives the num digits, but I don't know how to multiply something by not 10...)
answer = answer - (outArray[count]*pow(10, (numdigits-1));
numdigits -=;
count ++;
}
```

Also, I was wondering how would I go about pausing the program and waiting for a user’s input before continuing on with the program?