While programming in C I got stuck at the following code-snippet:
While converting from char array input to integer array digit, only the ANSI code is converted to the digit array.
How can I make sure the correct integer-value is given to this array ?
This is the relevant code:
int main(void) {
int x = 0;
int y = 0
char input[12] = {0};
int digit[12] = {0};
scanf("%s", &input[0]);
fflush(stdin);
while (input[y] != '\0') {
if (isdigit(input[y])) {
digit[x++] = input[y++];
count++;
}
else y++;
}
}