visual c++: convert int into string pointer

前端 未结 10 2144
既然无缘
既然无缘 2021-01-22 09:01

how to convert integer into string pointer in visual c++?

10条回答
  •  时光取名叫无心
    2021-01-22 09:30

    Take any C and C++ textbook. This simple C code should work in Visual C++ and others C++ compilels and convert 489 into "489":

    char result[100];
    int num = 489;
    sprintf(result, "%d", num);
    

提交回复
热议问题