Are call by reference functions of type int or double legal when using an ifstream or ostream argument?

Example:

int afunction(ifstream& in, int anumber)
{
/* Function Body */
}

If this is/isn't legal please explain. Thank you for your help.

-Arielle

Of course its legal -- you just forgot the & symbol after int

int afunction(ifstream& in, int& anumber)
{
/* Function Body */
}

I thought it was "legal" to mix parameter lists.

Also thanks for the quick reply :)

I thought it was "legal" to mix parameter lists.

Yes, you can mix and match as you wish.

In fact, fstream parameters must be passed by reference by the current standards. Pass by value should result in a compiler error.