The input should be a number (entered in one line) like 83809684986986904 (the number is not less than 13 digits and not more than 10^5 digits). I want to make an integer array (not char because I'll use the single digits for arithmetic operations) containing single digit integers out of this number. So in this case, arr[0] = 8, arr [1] = 3 and so on. How can I achieve this?
Something that is 10^5 digits long is not going to be stored in an integer, so it must be input as a string (or be added directly a vector through stream.get() loop).
To convert each char in the string to an integer, you can do int digit = str[i] - '0';