Convert uint64_t to std::string

后端 未结 4 1074
时光说笑
时光说笑 2021-02-13 23:42

How can I transfer uint64_t value to std::string? I need to construct the std::string containing this value For example something like this:

void genString(uint6         


        
4条回答
  •  情歌与酒
    2021-02-14 00:09

    string genString(uint64_t val)
    {
       char temp[21];
       sprintf(temp, "%z", val);
       return temp;
    }
    

提交回复
热议问题