I am trying to print an array using this code.
My expectation would be that it prints out a bunch of 0s but for some reason it is not doing so
int arr[10]; //Initialize all 10 elements to 0
printArray(arr);
void printArray(int in[]) {
cout << "Array: " << endl;
for (int i = 0; i < sizeof(in) / sizeof(in[0]); i++) {
cout << ", " << in[i];
}
cout << endl;
}
What am I doing wrong?