Assigning each digit of an int to an int array

Posted by John Doe on Stack Overflow See other posts from Stack Overflow or by John Doe
Published on 2010-05-26T20:02:24Z Indexed on 2010/05/26 20:11 UTC
Read the original article Hit count: 161

Filed under:
|
|

Is it possible to retrieve an integer using scanf and assigning each digit to a int array?

I'm trying to achieve it doing it this way:

int numbers[];
puts("Enter number");
int x;
scanf("%d",x);
numbers = malloc(x);
numbers = x;

© Stack Overflow or respective owner

Related posts about c

    Related posts about arrays