The function open() can be used to open multiple files that use the same stream object. For example, we may want to process a set of files sequentially. In such cases, we may create single stream object and use it to open each file in turn.
// Creating files with open() function
#include
#include
int main()
{
ofstream fout; // create output stream
fout.open(“country”); // connect “country” to it
fout