+ 1
Does a file will be global if its objected is created globally but opened in main or any other function?
#include <fstream> using namespace std; ifstream fin; int main(){ fin.open("test.txt",ios::in|ios::binary); .... } In the above code if the file opened is global (can it be use globally or not).
1 Respuesta
0
Yes. It will be accessable file fin (P.S. don't forget to close it)