码迷,mamicode.com
首页 >  
搜索关键字:assert    ( 2161个结果
C++【String类】String插入单个字符,插入字符串的函数实现
#include<iostream> #include<stdlib.h> #include<assert.h> usingnamespacestd; classString { public: String(constchar*str) :_str(newchar[strlen(str)+1]) { _size=strlen(str); _capacity=_size+1; strcpy(_str,str); } String(constString&s) :..
分类:编程语言   时间:2016-01-27 17:41:22    阅读次数:237
C++【String类】String查找单个字符,查找字符串的函数实现
#include<iostream> #include<stdlib.h> #include<assert.h> usingnamespacestd; classString { public: String(constchar*str) :_str(newchar[strlen(str)+1]) { _size=strlen(str); _capacity=_size+1; strcpy(_str,str); } String(constString&s) :..
分类:编程语言   时间:2016-01-27 17:40:55    阅读次数:197
C++【String类】String删除单个字符,删除字符串的函数实现
#include<iostream> #include<stdlib.h> #include<assert.h> usingnamespacestd; classString { public: String(constchar*str) :_str(newchar[strlen(str)+1]) { _size=strlen(str); _capacity=_size+1; strcpy(_str,str); } String(constString&s) :..
分类:编程语言   时间:2016-01-27 17:39:34    阅读次数:185
字符串转化为整数的算法改进及优化
我们知道C语言有一个库函数atoi(表示alphanumerictointeger)是把字符串转换成整型数的一个函数。那么如何实现这个函数呢?很多同学很快会写出下列代码:intStrtoInt(charstr[]) { assert(str); intnum=0; while(*str) { num=num*10+*str-‘0‘; ++str; } returnnum; }这..
分类:编程语言   时间:2016-01-26 01:50:35    阅读次数:165
Nginx性能优化
一、编译安装过程优化1、减小Nginx编译后的文件大小在编译Nginx时,默认以debug模式进行,而在debug模式下会插入很多跟踪和ASSERT之类的信息,编译完成后,一个Nginx要有好几兆字节。而在编译前取消Nginx的debug模式,编译完成后Nginx只有几百千字节。因此可以在编译之前,...
分类:其他好文   时间:2016-01-23 10:27:36    阅读次数:324
【转】嵌入式C语言调试开关
在调试程序时,经常会用到assert和printf之类的函数,我最近做的这个工程里就有几百个assert,在你自认为程序已经没有bug的时候,就要除去这些调试代码,应为系统在正常运行时这些用于调试的信息是无用的,而且会占用时间和空间。怎么删除呢,俺以前都是用笨方法,一个一个注释,能用注释也是经过改进...
分类:编程语言   时间:2016-01-23 00:53:36    阅读次数:211
再谈单链表
#pragmaonce #include<stdio.h> #include<string.h> #include<assert.h> #include<stdlib.h> typedefintDataType; //定义一个结构体类型 typedefstructLinkNode { DataTypedata;//定义节点的数据 structLinkNode*next;//保存下一个类型节点的地址 }..
分类:其他好文   时间:2016-01-21 15:56:21    阅读次数:113
java中的断言
断言:也就是所谓的assertion,是jdk1.4后加入的新功能。它主要使用在代码开发和测试时期,用于对某些关键数据的判断,如果这个关键数据不是你程序所预期的数据,程序就提出警告或退出。当软件正式发布后,可以取消断言部分的代码。java中使用assert作为断言的一个关键字,这就可以看出java对...
分类:编程语言   时间:2016-01-21 10:24:25    阅读次数:208
C语言【顺序表】冒泡排序,一次选出最大最小的数据,二分查找,初始化顺序表
#define_CRT_SECURE_NO_WARNINGS1 #include<stdio.h> #include<assert.h> #include<stdlib.h> #include<string.h> #defineMAX_SIZE5 typedefintDataType; typedefstructSeqList { size_tsize; DataTypearray[MAX_SIZE]; }SeqList; //冒泡排序 //v..
分类:编程语言   时间:2016-01-18 20:59:01    阅读次数:302
C语言【顺序表】顺序表的初始化,头插,尾插,头删,尾删,增删查改,全删
#define_CRT_SECURE_NO_WARNINGS1 #include<stdio.h> #include<assert.h> #include<stdlib.h> #include<string.h> #defineMAX_SIZE5 typedefintDataType; typedefstructSeqList { size_tsize; DataTypearray[MAX_SIZE]; }SeqList; //voidInitSeqLis..
分类:编程语言   时间:2016-01-18 20:55:58    阅读次数:250
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!