Где искать: по сайтам Запорожской области, статьи, видео ролики
пример: покупка автомобиля в Запорожье
Files are used to store data permanently.
In this video, you’ll learn how to read and write into text files using C++.
In order to work with files, first, include the fstream library.
Inside this library there are three data types:
ofstream - used for writing into files
ifstream - used for reading from files
fstream - used for both read and write
In this video, I’m demonstrating the use of fstream object in file handling.
In order to open a file we use open() function.
This function receives two parameters: file name and file open mode.
The modes in which file can be opened are below:
ios::in - opens the file to read(default for ifstream)
ios::out - opens the file to write(default for ofstream)
ios::binary - opens the file in binary mode
ios::app- opens the file to append new info at the end
ios::ate - opens and moves the control to the end of the file
ios::trunc - removes the data in the existing file
ios::nocreate - opens the file only if it already exists
ios::noreplace - opens the file only if it doesn’t already exist
We can also combine different modes using symbol |
For example:
myFile.open(“saldinaFile.txt”, ios::out | ios::in);
In this example, we are opening saldinaFile.txt for both writing and reading.
Contents:
00:00 - Intro
01:12 - Write into a text file using C++
07:56 - Append to a text file using C++
10:45 - Read from a text file using C++
16:06 - Tasks to test your C++ knowledge!
???????????? Create Modern Apps, Download Your FREE C++Builder Trial Today: https://bit.ly/CppBuilderFree
Task 1. ASCII Table video: http://bit.ly/asciiTable
Task 2. Structures video: https://bit.ly/structuresVideo
Tag me on you Instagram stories:
Instagram ???? - https://www.instagram.com/truecodebeauty/
Twitter ????- https://twitter.com/TrueCodeBeauty