#define_CRT_SECURE_NO_WARNINGS1#include"CommentConvert.h"StateTypestate;voidDoNullState(FILE*read,FILE*write){intfirst=fgetc(read);intsecond=0;switch(first){case‘/‘:second=fgetc(read);if(second==‘*‘){fputc(first,write);fputc(‘/‘,write);state=C_STATE;}elseif..
分类:
编程语言 时间:
2016-03-21 01:49:24
阅读次数:
293
深拷贝实现string类#define_CRT_SECURE_NO_WARNING1
#include<iostream>
#include<string>
usingnamespacestd;
classString
{
public:
friendostream&operator<<(ostream&os,String&str);
friendStringoperator+(constString&str1,constStri..
分类:
编程语言 时间:
2016-03-20 02:25:53
阅读次数:
692
#define_CRT_SECURE_NO_WARNINGS1
#include<iostream>
usingnamespacestd;
#include<assert.h>
typedefintDataType;
classSeqList
{
public:
SeqList()
:_array(NULL)
,_size(0)
,_capicity(0)
{}
SeqList(constSeqList&sList)
:_array(newDataType[sList._..
分类:
编程语言 时间:
2016-03-18 02:01:15
阅读次数:
302
#define_CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
#include<stdlib.h>
#defineMAX_SIZE5
typedefintDataType;
typedefstructSeqlist
{
DataTypearr[MAX_SIZE];
size_tsize;
}Seqlist;
voidPrintSeqList(Seqlist*pSep);
voidInitSeqList..
分类:
编程语言 时间:
2016-03-17 19:38:42
阅读次数:
272
检测内存泄漏的主要工具是调试器和 CRT 调试堆函数。若要启用调试堆函数,请在程序中包括以下语句: 通过包括 crtdbg.h,将 malloc 和 free 函数映射到其“Debug”版本 _malloc_dbg 和 _free_dbg,这些函数将跟踪内存分配和释放。此映射只在调试版本(在其中定义
分类:
编程语言 时间:
2016-03-16 22:35:41
阅读次数:
246
程序片段(01):加法.c
内容概要:字符串计算表达式#define _CRT_SECURE_NO_WARNINGS
#include
#include //01.去除空格:
// 1.空格:空格+Tab键+类似符...
// 2.双索引+双指针
// 变化快+变化慢:变化快覆盖变化慢
void removeBlankSpaceByIndex(...
分类:
其他好文 时间:
2016-03-15 06:24:32
阅读次数:
261
程序片段(01):ReplaceAll.c
内容概要:ReplaceAll#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include //01.(删除+替换)所有指定字符串
// (双索引+双指针)-->(删除+替换)原理
// 注:增加(拓展)+删除(压缩)+修改(压缩|不...
分类:
其他好文 时间:
2016-03-15 06:23:53
阅读次数:
250
程序片段(01):对称.c
内容概要:对称#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include //01.对称原理:
// 1.双索引or双指针-->双边对称夹逼-->进行字符比对
// 2.判断存在情况,默认所有情况
int isSemmetry(char * pSt...
分类:
其他好文 时间:
2016-03-15 06:21:56
阅读次数:
296
#define_CRT_SECURE_NO_WARNINGS
#include<iostream>
usingnamespacestd;
#include<assert.h>
#include<stdio.h>
#include<string.h>
15.一小球从100米高度自由落下,每次落地后反跳回
原高度的一半,再落下,求它在第10次落地时,共经过多少米?
第10..
分类:
编程语言 时间:
2016-03-12 14:52:56
阅读次数:
309
写时拷贝--CopyOnWrit#define_CRT_SECURE_NO_WARNINGS
#include<iostream>
usingnamespacestd;
classString
{
public:
String(char*str=""):_str(newchar[strlen(str)+5])
{
_str+=4;
_GetRefCount(_str)=1;
strcpy(_str,str);
}
String(String&s):_str(s._str)
{
++..
分类:
编程语言 时间:
2016-03-12 14:52:30
阅读次数:
213