2014年4月16日 星期三

[C] copy A memory to another memory B by using memcpy


[C] copy A memory to another memory B by using memcpy





/*

 * void *memcpy(void *dest, const void *src, size_t n);

 * */

#include <stdio.h>

#include <stdlib.h>



#define BuffSize 0x10000



int main()

{

    char bufA[BuffSize]={0x31,0x32,0x33};

    char bufB[BuffSize];



    memcpy(bufB,bufA,BuffSize);

    printf("bufB = %s\n",bufB);

}



Reference:






 


Related Posts:

0 意見:

張貼留言