how to convert from int to char*?

前端 未结 10 2089
旧巷少年郎
旧巷少年郎 2020-11-30 18:37

The only way I know is:

#include 
#include 
using namespace std;

int main() {
  int number=33;
  stringstream strs;
  strs &l         


        
10条回答
  •  一生所求
    2020-11-30 18:54

    This might be a bit late, but i also had the same issue. Converting to char was addressed in C++17 with the "charconv" library.

    https://en.cppreference.com/w/cpp/utility/to_chars

提交回复
热议问题