int a=30;
char str[]="test";
sprintf(buffer,"%d%s",a,str);

解决方案 »

  1.   

    sprintf()
    CString 的Format()
      

  2.   

    toascii(30)结果不是已经是个字符了吗?
    VC中字符串连接也必须这么干吗???
      

  3.   

    我想根据30得到对应的ASCII字符,不是用Toascii函数吗?
      

  4.   

    CString s;
    s=(char)0x30;    //0x30 ='0'
    s+="text";
    strcpy(buf,s.GetBuffer(10));   //buf为"0text"
    s.ReleaseBuffer();
      

  5.   

    本想在SOCKET中把数据和字符串用一次SEND发走,看来只好分着发送了。int a = 30
    int b = 2
    int c = 0
    char strtemp[] = "test"send(socket1, buffer, len, 0)
      

  6.   

    做的是个DOS测试程序。不能用MFC 类
    怪我没说清