03 2012 档案
摘要:1char*strchr(constchar*s,intc){constcharch=c;for(;*s!=ch;++s)if(*s!='\0')return(NULL);return((char*)s);}2char*strrchr(constchar*s,intc){constcharch=c;constchar*sc;for(sc=NULL;;++s){if(*s==ch)sc=s;if(*s=='\0')return((char*)sc);}}3 char *strstr(const char *s1, const char *s2){if(*s2==&
阅读全文
摘要:VS : Error Message in DebugMode:Heap Corruption DectectedAfter Normal block (#81) at 0x003f74c0 CRT detected that the application wrote to memory after end of heap bufferwhich is not appeare in Release Mode ( it terminate itself sliently)This is a typical memory leak:Reason of my situation:inttotal_
阅读全文
摘要:chargreeting[]=“Hello”;char*p=greeting;//non-constpointer,non-constdataconstchar*p=greeting;//non-constpointer,constdata;char*constp=greeting;//constpointer,non-constdata;constchar*constp=greeting;//constpointer,constdata;这是书中的解释。const char *p 平时用的最多,自然不需特殊记忆。---指向的内容为常量,内容不可以改变。char * const p 则相反,p
阅读全文