In C, whenever you pass an array to a function, only a pointer to the first element of said array is passed into the function (this is called "array to pointer decay").
In order to print every element inside an array, you have to access every single one of them and print them individually, using the []
operator. Like this:
for(int i = 0; i < 5; i++){
printf("%i", arr[i]);
}
Also, remember that arrays are 0 based, meaning arr[0]
is the first element, but arr[5]
is not a valid element, as it's out of bounds.