size_t Cmystr::_mystrlen (charConst * srcstr) { 0; if (Srcstr! = NULL) { while'+ ') { len++ ; } } return Len; // The last question of the string is ' \ ', the length of the string includes ' + '
//numeric processing of stringsCMYSTR (inti) {intTempVal =i; BOOLISFU =false; if(TempVal <0) {len=2;//-No.ISFU =true; TempVal= -TempVal; } ElseLen=1;// / while(tempval) {TempVal/=Ten; Len++; } pStr=New Char[Len]; * (PStr + len-1) =' /'; if(ifful) {TempVal= -i; } ElseTempVal=i; intindex =0; while(tempval) {inttemp = tempval%Ten; * (PStr + len-2-index) = temp +'0';//convert to character typeTempVal/=Ten; Index++; } if(ISFU)*pstr ='-'; }
//alphabetic ASCII code a--65 a--97 Char*str; intcounter[ -]; voidDoc::count () { for(inti =0; i < length; i++) { if(Str[i] >='a'&& Str[i] <='Z') Counter[str[i]-'a']++; if(Str[i] >='A'&& Str[i] <='Z') Counter[str[i]-'A']++; } for(intindex =0; Index < -; ++index) cout<< (Char) (Index + $) <<"or"<< (Char) (Index + the) <<"The number of occurrences is:"<< Counter[index] << Endl;
c++--string ASCII numeric string