fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. short c = 10;
  7. short d;
  8. char string[10];
  9. sprintf(string, "%x", c);
  10. d = atoi(string);
  11. printf("c = %d\n", c);
  12. printf("d = %d\n", d);
  13. return 0;
  14. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
c = 10
d = 0