My code is supposed to remove a specified value and shift the array. When I run the code it prints an address instead of the contents of the array. What is wrong with my code?
using namespace std;
void arrayShift(int arr[], int length, int value) {
for(int i = 0; i<length; i++) {
if(arr[i] == value) {
for (int k = i; k<length-1 ; k++) {
arr[k] = arr[k+1];
}
arr[length-1] = 0;
i--;
}
}
cout << arr;
}
int main() {
int inputarr[]={9,8, 9, 9, 9, 9, 6};
int length = 7;
int value = 9;
arrayShift(inputarr,length,value);
}