资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

c windows编程中如何显示“浮点数据”...wsprintf与TextOut无法处理“浮点数据”。

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

操作系统:WINXP+SP2  
  开发工具:VC6  
  语言:C  
   
  如是。

网友回答:

发表者:yangsongx

atof  
  或_gcvt等函数是可以的。

发表者:Flood1984

float   f;  
  CString   str;  
  str.Format("%f",str);  
  //int   类似

发表者:keiy

要用MFC,以下是我的  
  void   CTestmfcDlg::OnButton2()    
  {  
  //   TODO:   Add   your   control   notification   handler   code   here  
        CString   x;  
        x.Format("%f",1.222);  
        MessageBox(x);  
         
  }  
   
  你的错误是什么?

发表者:alextooter

#include   "stdio.h"  
   
   
          char   buf[100]   ;  
          float   f1   =   100.303;  
  HDC   hdc;  
  case   WM_PAINT:  
  hdc   =   BeginPaint(hWnd,   &ps);  
  //   TODO:   Add   any   drawing   code   here...  
  RECT   rt;  
  GetClientRect(hWnd,   &rt);  
                          memset   (buf,   0,   100);  
                          sprintf   (buf,   "%f",f1);  
  DrawText(hdc,   buf,   strlen(buf),   &rt,   DT_CENTER);  
  EndPaint(hWnd,   &ps);  
  break;  
 


 

 
热门推荐笔记本: 七喜笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved