超级简单问题(在线等)

westhillchen 2003-03-25 02:02:52
在VC++里怎么将一个整型或数值型数据转换成字符串类型(CString)
我用(CString)aaa,转了过后怎么变得不认识了哈,
我要的是比如222转后就是"222"
...全文
27 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
HAPPYDC2645VC 2003-03-27
  • 打赏
  • 举报
回复
itoa 整型->字符型
atoi 字符型->整型
atof 字符型->单精度
atod 字符型->双精度
这些函数在C库就有了<stdlib.h>
double atof(const char *string);
int atoi(const char *string);

westhillchen 2003-03-26
  • 打赏
  • 举报
回复
没有CSTRING的吗?
kicool 2003-03-25
  • 打赏
  • 举报
回复
itoa 整型->字符型
atoi 字符型->整型
atof
ftoa
这些函数在C库就有了<stdlib.h>
double atof(const char *string);
int atoi(const char *string);
rootond800 2003-03-25
  • 打赏
  • 举报
回复
up
我发誓
楼上一定对。
wbstevennudt 2003-03-25
  • 打赏
  • 举报
回复
itoa,atoi ,atof,都是,你查帮助或msdn就可以了
wjt2000 2003-03-25
  • 打赏
  • 举报
回复
up
itoa 整型->字符型
atoi 字符型->整型
trcd2000 2003-03-25
  • 打赏
  • 举报
回复
用itoa()可以的吧
itoa(int data,CString tmp,int n);
zsal 2003-03-25
  • 打赏
  • 举报
回复
int a = 222;
CString b;
b.Format("%d\n", a);
MessageBox(b);

沒有錯﹐你可以再試一下。
westhillchen 2003-03-25
  • 打赏
  • 举报
回复
晕,不行啊
空中猎手 2003-03-25
  • 打赏
  • 举报
回复
%d是参数,说明是后面的a是数值!\n是换行符!说错了别怪我,我乱说的!
westhillchen 2003-03-25
  • 打赏
  • 举报
回复
%d\n是何意
cenlmmx 2003-03-25
  • 打赏
  • 举报
回复
int a=222;
CString b;
b.Format("%d\n",a);

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧