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); File Pointers and Manipulation
The post What are different file modes in c++ appeared first on Coding Security.
What are different file modes in c++
read more
Tidak ada komentar:
Posting Komentar