1. 内存申请 calloc, calloc(num,size) 申请num个size大小的空间。
2. 字符串
strncpy (str1,str2,num)
char* res;
char* str = "abcd";
res = calloc( strlen(str)+1, sizeof(char));
strncpy(res, str, sizeof(str));
3
定义函数:int memcmp (const void *s1, const void *s2, size_t n);
函数说明:memcmp()用来比较s1 和s2 所指的内存区间前n 个字符。