CodeClerks

Opening Files Using open() in C++



Enter a reason for deleting this comment

Opening Files Using open() in C++

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

Comments

Please login or sign up to leave a comment

Join