Alright, message to self, don't bump old threads to ask another question. :(
Ok my problem was that I was using a double instead of an integer!
Now things work crystal clear!Code:#include <stdio.h>
#include <stdlib.h>
int main() {
char str[100];
int num;
scanf("%d", &num); // Put input into variable num
sprintf(str, "%d", 34);
printf("%d --> %s\n", num, str);
return 0;
}
Code:34
34 --> 34