You are viewing a single comment's thread. Return to all comments →
int ArrayFunction(int size) { int arr = new int[size]; if(size >= 1 && size <= 1000) { for (int i = 0; i < size; i++) { std::cin >> arr[i]; } } else { return nullptr; }
for(int i = size - 1; i > -1; i--) { if(arr[i] >= 1 && arr[i] <= 10000) { std::cout << arr[i] << " "; } else{ return nullptr; } } return arr;
}
int main() { int arrayIndex;
std::cin >> arrayIndex; int* arrayFunctionPtr = ArrayFunction(arrayIndex); delete[] arrayFunctionPtr; return 0;
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays Introduction
You are viewing a single comment's thread. Return to all comments →
include
int ArrayFunction(int size) { int arr = new int[size]; if(size >= 1 && size <= 1000) { for (int i = 0; i < size; i++) { std::cin >> arr[i]; } } else { return nullptr; }
}
int main() { int arrayIndex;
}