No, arr is an array. It gets evaluated as a pointer to the first element in the array, but that's an rvalue you're not going to get a non-const reference to.
Name:
Anonymous2014-02-23 23:37
I'm sure arthur could tell you... =)
Name:
Anonymous2014-02-23 23:42
void printArr(int* &arr, int size)
vS
void printArr(int arr[], int size)
?
Name:
Anonymous2014-02-24 0:51
Now, I haven't used sepples since college, by isn't int* & arr a reference to a pointer, making the array passed in printArr(arr,20); //this line doesn't work be dereferenced twice, thus try to access memory address 0x05, while the arr_p works fine?
Use a language with real arrays. listArray (1,20) [5,5,8,9,3,2,6,7,93,2,43,193,78,7,6,59,3,17,53,9] :: UArray Int Int
Or if you prefer a lower bound of 0: listArray (0,19) [5,5,8,9,3,2,6,7,93,2,43,193,78,7,6,59,3,17,53,9] :: UArray Int Int