标签:des style blog http color os ar sp div
void* memove(void* dest,const void*src,size_t count) { assert((dest != NULL) && (src != NULL)); assert(count>0); char* psrc = (char*)src; char* pdest = (char*)dest; //检查是否有重叠问题 if(pdest < psrc) { //正向拷贝 while(count--) *pdest++ = *psrc++; } else if(psrc < pdest) { //反向拷贝 psrc = psrc + count -1; pdest = pdest + count -1; while(count--) *pdest-- = *psrc--; } return dest; } void* memmcpy(void* dest,const void* src,size_t count) { assert((dest != NULL) && (src != NULL)); assert(count > 0); char* psrc = (char*)src; char* pdest = (char*)dest; while(count --) *pdest++ = *psrc++; return dest; }
标签:des style blog http color os ar sp div
原文地址:http://www.cnblogs.com/kangbry/p/4040859.html