so .. in c if i had a file pointer
e.g:
How woud i do the same in c++??Code:void function(FILE *inputfile){ int c; fscanf(inputfile,"%d",c); } int main(){ FILE *inputfile=fopen("myfile.txt","r"); function(inputfile); fclose(inputfile); return 0; }
I couldn't find it anywhere in google or in my books.
My guess is ...
Code:void function ( ???? ){ int c; ??? >> c ; } int main(){ ifstream inputfile("myfile.txt"); function(???); inputfile.close(); return 0; }