拥有char *
及其int length
如何将其深度复制到stringstream
?
问问题
313 次
3 回答
3
使用std::stringstream::write(s, length);
.
请注意,如果可以使用char*
is null 终止并且不需要提供:operator<<()
length
std::stringstream s;
const char* buf = "hello";
s << buf;
于 2012-12-14T14:09:13.470 回答
1
不应该写完全满足您的要求吗?
于 2012-12-14T14:09:08.903 回答