Parsing Integer to String C

前端 未结 9 988
情深已故
情深已故 2020-12-14 08:58

How does one parse an integer to string(char* || char[]) in C? Is there an equivalent to the Integer.parseInt(String) method from Java in C?

9条回答
  •  星月不相逢
    2020-12-14 09:02

    You can also check out the atoi() function (ascii to integer) and it's relatives, atol and atoll, etc.

    Also, there are functions that do the reverse as well, namely itoa() and co.

提交回复
热议问题