If i try run the program without the "if(next_is_exist)" statement the program throw "String index out of range: 1". I also tried "if(next != NULL)" but is doesn't work. Please help me fill "next_is_exist" in the code below.
int arr[] = new int[5];
for (int i = 0; i < 5; i++) {
int current = arr[i];
int next = arr[i + 1];
if (next_is_exist) {
...
}
}
Aucun commentaire:
Enregistrer un commentaire