知道 CString 和 float 怎么相互转换吗 ?
别说让我回去看啊 ~
嘿嘿~~

解决方案 »

  1.   

    long atol( const char *string );
      

  2.   

    CString temp;
    float fData;
    temp.Format("%f",fData);//浮点型到字符。
    temp=atof(temp.GetBuffer(temp.GetLength())); //字符到浮点型
    Ok
      

  3.   

    应该是这样吧:呵呵
    float a =atof(ctring)
    CString str.Format("f%",a);
      

  4.   

    楼上的
    temp=atof(temp.GetBuffer(temp.GetLength())); //字符到浮点型
    这样会发生数据丢失吗 ?
    warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
      

  5.   

    float f;
    CString str;
    float转CString时
    str.Format("%f",f);CString转float时
    f = atof(str);
      

  6.   

    CString  m_lNewNum;
       float ss;
    ==>ss=atof(m_lNewNum);
    警告
      

  7.   

    float a =atof(string)
    str.Format("%f",a)
    sprintf(sz, "%f", a)