【发布时间】:2011-08-26 11:18:23
【问题描述】:
你能告诉我如何将buf向量的大小变成动态长度吗?
long five = 555;
char buf[256];
snprintf(buf, sizeof(buf), "%d", five);
谢谢!
如何使用std::vector<std::string>buf; 更改我的代码才能正常工作?
我有错误:
vector 不是 std 的成员;
之前的预期主表达式
buf 未在此范围内声明并出现错误:在 ">" 标记
【问题讨论】:
-
我要转换的值是long值;
-
#include <vector> #include <string>