rt

解决方案 »

  1.   

    将整数,浮点数转换成字符串后在用messagebox输出。
      

  2.   

    你用CString不行吗?
    int a = 2;
    double b = 2.0;
    CString string;
    string.Format("%d and %f", a, b);
    然后在MessageBox中用string做参数。
      

  3.   

    float n=1.22223;
    char a[255];
    sprintf(a,"%7.6f",n);
    MessageBox(a);
      

  4.   

    double c =5.5;
    int a =8;
    CString str;
    str.Format("%d and %f", a, c);
    MessageBox(str);
      

  5.   

    float fVar=1.5;
    int   iVar=1;
    CString  strVar;
    strVar.Format("%f,%d",fVar,iVar);
    MessageBox(strVar);
      

  6.   

    float x=1.5;
    int y=1;
    CString str;
    str.Format("[%f],[%d]",x,y);
    MessageBox(str);
      

  7.   

    float fl=543254.54325;
    CString str;
    str.Format("%f",fl);
    MessageBox(str);这样就可以了呀