c++--string ASCII numeric string

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.