0

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

3
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by vmanes
0

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

Also thanks for the quick reply :)

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.