C++ signed char 转 string
时间: 2023-11-18 17:03:14 浏览: 193
c++字符转换
可以使用stringstream来将signed char转换为string,示例代码如下:
```c++
#include <iostream>
#include <sstream>
int main() {
signed char c = 'a';
std::stringstream ss;
ss << c;
std::string str = ss.str();
std::cout << str << std::endl;
return 0;
}
```
输出结果为:
```
a
```
阅读全文