pDataBuffer = new BYTE[DataBufOffset]; 
pDataBufferA = new BYTE[DataBufOffset]; 我想比較這兩個內存中的內容有什麼不同,想知道不同開始的地方,有什麼好方法或好工具?

解决方案 »

  1.   

    CDaoWorkspace::CompactDatabase
    static void PASCAL CompactDatabase( LPCTSTR lpszSrcName, LPCTSTR lpszDestName, LPCTSTR lpszLocale = dbLangGeneral, int nOptions = 0 );
    throw( CDaoException, CMemoryException );???是不是这个意思
      

  2.   

    可以用memcpy。memcpy
    Copies characters between buffers.
    Routine Required Header 
    memcpy <memory.h> or <string.h> void *memcpy( void *dest, const void *src, size_t count );
    Parameters dest 
    New buffer 
    src 
    Buffer to copy from 
    count 
    Number of characters to copy 
    LibrariesAll versions of the C run-time libraries.Return Valuesmemcpy returns the value of dest.ResThe memcpy function copies count bytes of src to dest. If the source and destination overlap, this function does not ensure that the original source bytes in the overlapping region are copied before being overwritten. Use memmove to handle overlapping regions.
      

  3.   

    自己比较就可以了...
    pDataBuffer = new BYTE[DataBufOffset]; 
    pDataBufferA = new BYTE[DataBufOffset]; 
    for(long i=0;i<DataBufOffset;i++)
    {
    if(pDataBuffer[i] != pDataBufferA[i])//这里肯定就是不同了
    ;//做相应处理,break
    }
    ....
      

  4.   

    不好意思,楼主,刚才csdn提交时,一直未成功,贴错了。如果只是比较,可用,
    Compare characters in two buffers.
    int memcmp( const void *buf1, const void *buf2, size_t count );从什么地方开始不同
    可用楼上newplayer1(琴剑江湖)的方法处理,应该是最简单的了。