c++ 数字转为string
2014-09-25 13:28
302 查看
#include
<iostream>#include
<string>using
namespace
std;
int
main() {
int
n
=
65535;
char
t[256];
string
s; sprintf(t,
"%d",
n); s
=
t; cout
<<
s
<<
endl;
return
0;
}
<iostream>#include
<string>using
namespace
std;
int
main() {
int
n
=
65535;
char
t[256];
string
s; sprintf(t,
"%d",
n); s
=
t; cout
<<
s
<<
endl;
return
0;
}
相关文章推荐
- c++&nbsp;数字转为string
- C++中的&nbsp;pair&lt;map&lt;string,&nbsp;int&gt;::i…
- LeetCode 8. String to Integer (atoi) C++ --字符串转为数字,包含正负号、空格、字母、数字等字符
- String转为Int 的异常错误
- 实战c++中的string系列--指定浮点数有效数字并转为string
- c/c++ 数字转成字符串, 字符…
- 实战c++中的string系列--指定浮点数有效数字并转为string
- C++ String Replace
- 实战c++中的string系列--指定浮点数有效数字并转为string
- C++&nbsp;使用&nbsp;string&nbsp;型態
- vb asp.net 判断值是否为数字
- C++判断string是不是数字|C++获取数组长度
- c/c++ 管道编程
- The string &quot…
- ZZULI 1234 数字串 解题报告
- (pbc lua 加入)c++_lua_Python with/without extension性能测试 (10万次SerializeToString & ParseFromString)
- json中string类型的datetime格式转换为datetime类型:例string类型"/Date(1242357713797+0800)/" 转为datetime类型"yyyy-MM-dd"
- C和C++混合编程(error C2059: syntax error : 'string')
- C++中int转为string
- C和C++混合编程(error C2059: syntax error : 'string')