i finish writing my code and i am unable to figure out why i am getting an expected ; error
i tried adding the ; where it expects me too but it kicks back other errors instead
here is my code
int main() {
int* expandArray(int *arr, int SIZE) { //this is the error line
//dynamically allocate an array twice the size
int *expPtr = new int[2 * SIZE];
//initialize elements of new array
for (int i = 0; i < 2 * SIZE; i++) {
//first add elements of old array
if (i < SIZE) {
*(expPtr + i) = *(arr + i);
}
//all next elements should be 0
else {
*(expPtr + i) = 0;
}
}
return expPtr;
}
}