随笔分类 -  C++

摘要:所谓动态内存分配(Dynamic Memory Allocation)就是指在程序执行的过程中动态地分配或者回收存储空间的分配内存的方法。动态内存分配不象数组等静态内存分配方法那样需要预先分配存储空间,而是由系统根据程序的需要即时分配,且分配的大小就是程序要求的大小。凡是在程序中用到系统提供的动态分... 阅读全文
posted @ 2014-05-30 21:26 生死相依 阅读(841) 评论(0) 推荐(0)
摘要:DLL中导出函数的声明有两种方式:一种为在函数声明中加上__declspec(dllexport),这里不再举例说明;另外一种方式是采用模块定义(.def) 文件声明,.def文件为链接器提供了有关被链接程序的导出、属性及其他方面的信息。 首先创建 一个DLL程序,.cpp中int __stdcal... 阅读全文
posted @ 2014-05-27 20:12 生死相依 阅读(742) 评论(0) 推荐(0)
摘要:#include using namespace std;int atoi(char* s){ int retval=0; int n=1; if (*s=='-') { n=-1; s++; } while (*s!='\0') { retval=retval*10+(*s-'0'); s... 阅读全文
posted @ 2014-04-24 18:41 生死相依 阅读(209) 评论(0) 推荐(0)
摘要:#include using namespace std;char *strcpy(char *strDest, const char *strSrc){ if ( strDest == NULL || strSrc == NULL) return NULL ; if ( strDest == s... 阅读全文
posted @ 2014-04-24 09:57 生死相依 阅读(181) 评论(0) 推荐(0)