A C++ question,
I know
int* foo(void)
foo will return a pointer to int type
how about
int &foo(void)
This question isn't C/C++ at all, as C does not have references, only pointers. An int& is a reference to an int. Also, you don't need void, it can just be int& foo();
void
int& foo();