Hello everyone, I am having trouble understanding why "12345" is not being displayed and instead the program either displays nothing or it will crash. Helps!
Code:#include <stdio.h> #include <stdlib.h> int main() { char* ch =0; /* A nice charstar to hold 12345 as a string */ int num=12345; /*12345 as a numerical value rather than a string */ sprintf(ch,"%i",num); /*To convert the integer num into a string and store in it charstar! */ printf("%s\n",ch); /*I want to see the results */ return 0; }