char temp[10];
_itoa(crc,temp,16);
strcat(buf,temp);

解决方案 »

  1.   


    void CKjyView::OnDraw(CDC* pDC)
    {
    CKjyDoc* pDoc = GetDocument();
    ASSERT_VALID(pDoc);
    // TODO: add draw code for native data here
    WORD crc=0xd01b;
             char* buf="123456ggh";
    CString kk;
    kk.Format("%s%x",buf,crc);
    pDC->TextOut(100,200,kk);
    }
      

  2.   

    word crc=0xd01b;
    char temp[10];
    _itoa(crc,temp,16);
    运行时出错
    word crc=0x20;
    char temp[10];
    _itoa(crc,temp,16);
    就不会!why?
      

  3.   

    Debuy Assertion Failed!program:...istrator\d:\test\debug\test.exe
    file:dbgheap.c
    Line:1011Expression:-CrtIsValidHeapPointer(pUserData)