how to convert str to int

  • ust sprintf()
sprintf(s, "%d", x);
printf("%s\n",s);