I likely don't understand sprintf. Thanks for your help.
sprintf(s,i); /*->warning: makes pointer from int*/
sprintf accepts the target
char as the first argument, and the rest of the arguments are the same as
scanf's (format string first, then additional args if present).
So, in your case, it would simply be:
char s; int i; scanf("%d",&i); sprintf(s, "%d", i);
For an input of 3,
s would become '3'.
sprintf(s, "%d%d", i, i);, it would become '33'.
The reason it tried to interpret
i as a pointer in your example, was that it expected a (char) pointer (the format string).