int iiii=atoi(s);float ffff=atof(s);
double dddd=atof(s);

解决方案 »

  1.   

    CString a="12";
    LPSTR p=a.GetBuffer(0);
    int result=atoi(p);//是不可以直接用CString对象作参数的
    float ffff=atof(p);
    double dddd=atof(p);
      

  2.   

    to WooSir(吴Sir) 
    >> int result=atoi(p);//是不可以直接用CString对象作参数的肯定可以啦CString s("1.234567");
    float ffff=atof(s);
      

  3.   

    CString str="3";
    atoi(str)即为整型。
    但atof(str)转换后为double型,如果你要当float型用,要做强制转换:
    static_cast<float>(atof(str))
      

  4.   

    CString a="12";
    LPSTR p=a.GetBuffer(a.GetLength()+1);
    int result=atoi(p);//是不可以直接用CString对象作参数的
    float ffff=atof(p);
    double dddd=atof(p);
      

  5.   

    我用了nne998(上上下下左右左右BABA)的方法,可以直接用.
    多谢各位
      

  6.   

    你就把CString当成一个char*,然后用atoi就可以了。
      

  7.   

    such as these questions,you can open a new project to try and so on,
    you'll get the answer and make some progress
      

  8.   

    其实 CString 有一个默认的 operator 的。。 operator LPCTSTR()
      

  9.   

    CString s("1.234567");
    float ffff=atof(operator LPCTSTR());  //这样咯