It is necessary to break the incoming string into substrings for further recognition. For example А1+В2+С3 . It is required to break from and to +. That is, it should be А1,В2,С3 . Code:
Find signs and write to the array position where these characters are found.

 for(i = 0; i<=str.Length(); i++) { if (str[i]=='+' || str[i]=='-' || str[i]=='*' || str[i]=='/' ) { pos[j] = i; k = j; j++; } } 

Next, break into substrings.

 for (j = 0; j<=k; j++) for (i = 0; i<=pos[j]; i++) a = a + str[i]; 

All that, but gives error RangeCheck Error . During the test, it turned out that he does not want to take str[1] (1, 2, 3 is not important - an error with this form of calculation is always). str type String read from Edit1 .

2 answers 2

 AnsiString str1; str1 = str; const char *c = str1.c_str(); //помогло 

    Change in cycles "<=", to "<"?

    Is there data in the str or is it an empty or null string?

    • It's not about "<=". In String, str = Edit1 = Text. If you take str = "asd", then everything works as it should. - Yaroslav Schubert