Home > Back-end >  C/C transfer uppercase lowercase problem for mistakes
C/C transfer uppercase lowercase problem for mistakes

Time:10-19




Class myCString class defined in the
Private members
Int num
Char * mystr;

Then see code, why do I always remind segment mistakes after running

CodePudding user response:

MyCString (char * STR)
{
Num=strlen (STR);
Mystr=new (STD: : nothrow) char [num + 1];
Memcpy (mystr, STR, num + 1);
}

In addition you deal with uppercase characters, * (mystr + I)=* (mystr + I), is redundant,
  • Related