码迷,mamicode.com
首页 >  
搜索关键字:assert    ( 2161个结果
内存泄漏+适配器+多态
//#pragmaonce //#include<iostream> //#include<string> //Singleton.hpp //#include<list> //#include<assert.h> //#include<stdarg.h> //usingnamespacestd; //structBlockInfo //{ // void*_ptr; // string_file; // int_line; // BlockInfo..
分类:其他好文   时间:2015-12-29 17:49:02    阅读次数:220
单例模式
//#pragmaonce //#include<iostream> //#include<string> //#include<list> //#include<assert.h> //usingnamespacestd; //structBlockInfo //{ // void*_ptr; // string_file; // int_line; // BlockInfo(void*ptr,constchar*file,intline) // :_ptr..
分类:其他好文   时间:2015-12-29 06:28:02    阅读次数:205
C语言中assert的使用
assert宏的原型为1 #include 2 void assert(int expression);作用为计算expression,若其值为假(0),先向stderr打印一条出错信息,后调用abort来终止程序运行!一般调试阶段使用assert,调试结束后可以通过在#include的语句之前插入...
分类:编程语言   时间:2015-12-27 20:24:39    阅读次数:184
检查内存泄漏
1.分配空间2.记录内存块信息3.调用构造函数(类型萃取)#include<iostream> #include<string> #include<list> #include<assert.h> usingnamespacestd; structBlockInfo { void*_ptr; string_file; int_line; BlockInfo(void*ptr,constchar*file,in..
分类:其他好文   时间:2015-12-26 23:52:18    阅读次数:387
【cocos2d-js官方文档】十、log
api修改情况。左边为新增,右边为原来的。cc.log 不变cc.warn 新增cc.error 新增cc.assert <-- cc.Assert此次改造有下面几点原因:加入原来没有的api:cc.warn、cc.error。改动cc.Assert名称。使其符合开发规范。新的api的使用范例:c....
分类:Web程序   时间:2015-12-26 20:54:14    阅读次数:218
c语言:两种方法实现字符串拷贝strcpy
实现字符串拷贝strcpy方法一://字符串拷贝函数的实现#include<stdio.h>#include<assert.h>voidmy_strcpy(char*dest,char*src)//src表示source源,dest目标{assert(dest!=NULL);assert(src);char*ret=dest;while(*dest++=*src++){;}returndest;}intmain(){chararr[2..
分类:编程语言   时间:2015-12-25 06:28:32    阅读次数:343
实现一个strcpy函数
#include<stdio.h>#include<assert.h>charmy__strcpy(char*dest,constchar*src){assert(dest!=NULL);assert(src);while(*src!=‘\0‘){*dest=*src;dest++;src++;}*dest=‘\0‘;}intmain(){chararr1[30];char*arr2={"studentaami"};ret=my__strcpy(arr1,arr2);printf("%..
分类:其他好文   时间:2015-12-23 02:15:13    阅读次数:169
<cassert>
文件名: (assert.h) 这是一个C语言的诊断库,assert.h文件中定义了一个可作为标准调试工具的宏函数: assert ;下面介绍这个宏函数:assert函数原型:void assert (int expression);函数描述: 如果这个宏函数形式的参数(expression...
分类:其他好文   时间:2015-12-20 23:55:49    阅读次数:196
assert 的使用
一直以来没分清什么时候该使用assert,什么时候该使用if。现在将其记录下来assert 用于检查参数的合法性以及某个预期的结果等,assert只在debug模式中在在。assert是面向程序员的,而不是面向用户,主要方便程序员能够检查及快速定位程序的逻辑错误(程序员自身带来的问题),如果在调试程...
分类:其他好文   时间:2015-12-20 14:33:33    阅读次数:128
Python 基础【第八篇】变量
1.变量定义: 给数据进行命名,数据的名字就叫做变量 2.变量格式:[变量名] = [值](注:python变量中名称不能使用以下字符因为已经被Python内部引用and,as,assert,break,class,continue,def,del,elif,else,except,exec,Fal...
分类:编程语言   时间:2015-12-19 12:26:04    阅读次数:151
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!