请教一下各位高手,如何在列表框当中显示非CString类的数据?比如如何显示整型或者浮点型数据? 请教一下各位高手,如何在列表框当中显示非CString类的数据?比如如何显示整型或者浮点型数据? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CString str;str.Format("%d",123);str.Format("%f",3.14); 将整型和浮点形的数据转换为字符串int a;float b;char str[20];sprintf(str,"%d%f",a,b); 对啊.转换成CString就是了有三种方法1. C语言的方法#include <stdio.h>...int x=100;char str[30];itoa(100,x);2. C语言方法#include <stdio.h>...int x=100;float x2=1.11111;char str[30];sprintf(m,"%f",x2);或sprintf(m,"%d",x);整数对应%d,浮点小数对应%f3.MFC中的方法就是 qiushuiwuhen(秋水无恨) 说的CString str;str.Format("%d",123);str.Format("%f",3.14); 可以格式化数据吗就如楼上几位所说的那样CString str;str.Format("%d",123);str.Format("%f",3.14);: tangl_99(Min-Kyeong) ( 已经讲得够狗详细了 关于CWnd的Create问题 MFC 编辑框 退格 我是新手,关于Faq里"如何取得xml中的数据?"一文的问题??? 菜鸟提问:求各位大侠给指条明路 ADO中,给Recordset的filter赋值就提示unhandled exception??? 用API函数编程应选择哪个工程? HDC dc = ::GetDC(NULL)与HDC dc = GetDC(NULL)有什么不同 RS码的问题~~有程序~~但是有错误 网络编程中多个线程同时发起多个接受调用的问题 MFC RichEdit如何实现光标在行末时可以通过鼠标选择文本? SQL语句中的中文问题 一个奇怪的问题,大家帮我看看。
str.Format("%d",123);
str.Format("%f",3.14);
int a;
float b;
char str[20];
sprintf(str,"%d%f",a,b);
有三种方法
1. C语言的方法
#include <stdio.h>
...
int x=100;
char str[30];
itoa(100,x);
2. C语言方法
#include <stdio.h>
...
int x=100;
float x2=1.11111;
char str[30];
sprintf(m,"%f",x2);
或sprintf(m,"%d",x);
整数对应%d,浮点小数对应%f3.MFC中的方法
就是 qiushuiwuhen(秋水无恨) 说的
CString str;
str.Format("%d",123);
str.Format("%f",3.14);
就如楼上几位所说的那样
CString str;
str.Format("%d",123);
str.Format("%f",3.14);: tangl_99(Min-Kyeong) ( 已经讲得够狗详细了