fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int x=0;
  5. char y[]={'5','4','\0'};
  6. int z=1;
  7. sscanf(y,"%zi",&x);
  8. printf("%i\n",x); //Each time value of x=0
  9. sscanf(y,"%1i",&x); //I want to make this 1 dynamic "int z"
  10. printf("%i",x); //Here x value =54.
  11. return 0;
  12. }
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
54
5