I've spent a better part of a couple of days trying to figure this out and I'm lost!
I have a value of type int stored to a variable. I am trying to take this value and extract each digit by using % 10 on the variable then dividing / 10 to move to the next digit until I have reached the first digit, starting from the last.
so for a value, Example: 12345 . I get 5, 4, 3, 2, 1 in that order.
|
int* digit = new int[count];
|
I have used come code to dynamically assign the values to an array. But, this this where I'm lost. there is pointer to an array I believe, I don't understands how this really works.
I know I can find the first and last digit buy keeping track with a count variable during a loop.
but can I compare the values in the array to find the largest and smallest digit
with this "pointer array". sorry I don't understand what is employed here, forgive my explanation.