I have an array int arr[5] that is passed to a function fillarr(int arr[]):
int arr[5]
fillarr(int arr[])
int fillarr(int arr[]) { for(...); return arr;
This is a fairly old question, but I'm going to put in my 2 cents as there are a lot of answers, but none showing all possible methods in a clear and concise manner (not sure about the concise bit, as this got a bit out of hand. TL;DR