2009年8月2日

【面试题目】strcpy 实现

摘要: char*strcpy(char*strDest,constchar*strSrc){assert(NULL!=strDest);assert(NULL!=strSrc);char*tmp=strDest;while("0" != (*tmp++ = *strSrc++)); return strD... 阅读全文

posted @ 2009-08-02 17:41 醉清风JM 阅读(263) 评论(0) 推荐(0)

【C】中malloc的使用

摘要: C中malloc的使用(转)C学习2009-07-23 10:46阅读1评论0字号:大中小malloc函数原型:extern void *malloc(unsigned int num_bytes);用法:#include 功能:分配长度为num_bytes字节的内存块说明:如果分配成功则返回指向被... 阅读全文

posted @ 2009-08-02 17:37 醉清风JM 阅读(4782) 评论(1) 推荐(2)

【C++】extern "C"的作用

摘要: 因为C、C++的编译器对函数名的修饰不同,为了保证在C、C++中编写的函数能够被互相调用,所以采用这个链接指示符以int func(int, int)为例,C的编译器会将名字改编为_func, 而C++的编译器会改编为_func_int_int 或_funcii(各编译器不同)。如果这个函数在C中编... 阅读全文

posted @ 2009-08-02 17:27 醉清风JM 阅读(1199) 评论(0) 推荐(0)

导航