怎么样把一个int变量 int a=10;CString s=“spsheep2003”变成
 “10spsheep2003”,我都被它弄火了~

解决方案 »

  1.   

    CString str;
    CString s = "spsheep2003";
    int a;
    a = 10;
    str.Format("%d",a);
    s = str +s;
      

  2.   

    呵呵~你说的是对的~我没用format是因为好像经过它的字符流好像会被改变。thankyou了
    现在只好用它了
      

  3.   

    一个4字节的int型的变量被转换为CString后它还是占4个字节么
      

  4.   

    CString str;
    int a;
    str.Format("'%d'spsheep2003",a);
      

  5.   

    一个4字节的int型的变量被转换为CString后它还是占4个字节么
    回答:你是不是把"int a = 10;"中的a和它代表的字符串搞混了,"str.Format(...)"的方法是将str格式化为一个a所代表的字符串,并没有更改a的类型!!!