Hello!
So I have a program where I need to open a file, pass the reader into a method, and then within the method read from the file. Then when control shifts out of the method, I need the file reader to be able to pick up where the method left off.
In c++ it would be something like this:
#include <fstream>
using namespace std;
int main()
{
ifstream fin;
fin.open("file.txt");
readFile(fin);
return 0;
}
void readFile(istream& in)
{
int hold;
in>>hold;
}
I'm having trouble figuring out what the parameter should be for the method in c#, like istream& out is in c++.
Thanks for any help!