passing a file to a function
Hey All, I've just starting learning C++ from C (Not that i was that good as C to begin with) and I'm trying to convert some programs dealing with file i/o form C to C++. I'm stuck at a spot where I have a file handle passed to a funciton, for example-
Code:
aFile=fopen("pic.bmp","rb");
filegetsize(aFile);
Then Later-
Code:
long filegetsize(somefile)
{
do stuff with somefile
}
But from what i understand of C++ you simply use
" TheFile.open ("pic.bmp",ios::binary | ios::in) " to open the file. However this doesn't give me a "file handle" that i can pass to another function as an argument. Am I making sense? How would one do this is C++?