Home > Software engineering >  "Initialization" : from "char" into "ATL: : CStringT <BaseType, StringTr
"Initialization" : from "char" into "ATL: : CStringT <BaseType, StringTr

Time:11-06

"Initialization" : from "char" into "ATL: : CStringT"
The main code:
Cstrings str_left=_T (" "), str_right=_T (" ");
For (j=0; j<=index; J++) {
Str_left +=STR. GetAt (j);
}
/* for (k=0; k<270; K++) {
[I] X [k]=0;
} */
SetZero (X [I]);
For (k=0; kCstrings TMP=str_left. GetAt (k);//string index for k letter
Int tmp1=atoi (TMP) GetBuffer (0));
[I] X [270 - str_left GetLength () + k]=tmp1;
}

CodePudding user response:

Int tmp1=_ttoi (TMP);

CodePudding user response:

GetAt returns a single character, can't be used to initialize a cstrings

inside loopCstrings TMP=str_left. GetAt (k);//string index for k letter
Int tmp1=atoi (TMP) GetBuffer (0));

Just repeat every time creates a temporary cstrings and only used to store one character at a time, efficiency is also very poor
You should write directly
[I] X [270 - str_left GetLength () + k]=atoi (str_left. GetAt (k));
Such as

CodePudding user response:

Directly using cstrings around, similar to, cstrings s=cstrings (char)
  • Related