I wrote the following code:
void buildArrays(char *pLastLetter[],int length[], int size, const char str[]) {
int i;
int strIndex = 0;
int letterCounter = 0;
for (i=0; i<size; i++) {
while ( (str[strIndex] != SEPERATOR) || (str[strIndex] != '') ) {
letterCounter++;
strIndex++;
}
pLastLetter[i] = &str[strIndex-1];
length[i] = letterCounter;
letterCounter = 0;
strIndex++;
}
}
and I'm getting the above warning on pLastLetter[i] = &str[strIndex-1];
pLastLetter is a pointers array that points to a char in str[].
Anyone knows why I'm getting it and how to fix it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…