字符格式转换

xiaoxiao2021-02-28  123

1、char* 或者 string 转wstring

char* str = "hello worlddd"; wstring wstr (str, str+strlen(str)); string str = "hello worlddd"; wstring wstr (str.begin(), str.end());

2、64位的整数转成字符串

char* buf[40]; memset(buf,0,40); int64_t v = 12345678901; sprintf(buf,"%lld",v);
转载请注明原文地址: https://www.6miu.com/read-30044.html

最新回复(0)