passing ifstream to a function as an argument

wxjunkie

Senior member
Nov 6, 2000
409
0
0
in C++ when passing an ifstream to a function like....

ifstream input;
input.open("file.txt");

function(ifstream);


would the prototype need to be declared with ifstream as being passed by reference?
void function(ifstream& input);
 

wxjunkie

Senior member
Nov 6, 2000
409
0
0
okay, I'm just trying to narrow a nagging problem down. i can't seem to get my file streams passed to the functions.