I wrote a program and created an object with fstream.
fstream f1; f1.open("s.dat",ios::out|ios::binary); f1.close();
Generally if there's no file such as s.dat, then it creates a file by the name but it it's creating one instead it exits the program. I have to then manually create a file.
Why is it happening so and is there any way that it creates a file automatically if it's not suppose to creating it by itself.