Advertisement
file-stream-object("filename", mode);
Advertisement
File Modes | Description |
---|---|
ios::in | Searches for the file and opens it in the read mode only(if the file is found). |
ios::out | Searches for the file and opens it in the write mode. If the file is found, its content is overwritten. If the file is not found, a new file is created. Allows you to write to the file. |
ios::app | Searches for the file and opens it in the append mode i.e. this mode allows you to append new data to the end of a file. If the file is not found, a new file is created. |
"ios::binary" | Searches for the file and opens the file(if the file is found) in a binary mode to perform binary input/output file operations. |
ios::ate | Searches for the file, opens it and positions the pointer at the end of the file. This mode when used with ios::binary, ios::in and ios::out modes, allows you to modify the content of a file. |
"ios::trunc" | Searches for the file and opens it to truncate or deletes all of its content(if the file is found. |
"ios::nocreate" | Searches for the file and if the file is not found, a new file will not be created. |
Advertisement
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement