When you pass an array to your function, test(), you are actually passing the address of the first element in the array. You can't pass an int to the function, only the address of (a pointer to) an int. You could actually pass the address of your int, sally, to test() like so:
the '&' operator in this context gets the address of the variable 'sally'. In a function definition however, it means that the function takes that variable by reference. These are two seperate things and a lot of people are tripped up by the fact that they use the same symbol '&'.
Note that if you do pass the address of a single variable to a function, the proper way to dereference the pointer is
although this
would also work.
"test[n]", where n is any int, essentially means "the variable at the address passed into the function, plus the size of "n" ints. If you have passed in the address of an array this allows you to access any element in the array by looping from 0 to n, but if you have passed the address of a single int variable then you cannot use this syntax if n is greater than 0.
If you still don't get it, this tutorial probably explains pointers much better than I just did.
http://www.cplusplus.com/doc/tutorial/pointers/