Senin, 28 November 2016

what are the different file modes in C++

Until now when using the constructor or open() function for reading or writing data to a file, we are passing only one argument i.e., the file name. We can also pass a second argument which specifies the file mode. The mode parameter specifies the mode in which the file has to be opened. We can specify one of the following modes available in ios file: A programmer can open a file in append mode by writing as follows: fstream object-name(“filename”, ios::app);   A programmer can combine multiple modes using the | symbol as follows: fstream object-name(“filename”, ios::out | ios::nocreate);  

The post what are the different file modes in C++ appeared first on Coding Security.


what are the different file modes in C++
read more

Tidak ada komentar:

Posting Komentar