例如,讓我們說我有以下: char str[] = "33MayPen5";
int length = strlen(str);
char buffer[length];
int j = 0;
for(int i = 0; i < length; i++) {
buffer[j] = // I would like to read the number 33 from str
所以我有一串字符串,我想在for循環中循環。當我達到某個通過布爾檢查的字符時,我想在該點之後將列表中的每個項目都取出並從那裏切斷。如下所示: for (int i = 0; i < charList.length; i++)
{ if (charList[i] == "a")
{
//put every char in charList between i and the