Загрузка страницы

C++ file handling for beginners! The easiest way to read/write into text files!

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.

🎁 Create Modern Apps, 5x faster, with less code, Download FREE C++Builder Trial: https://bit.ly/CppBuilderFree

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!

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

Видео C++ file handling for beginners! The easiest way to read/write into text files! канала CodeBeauty
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
28 апреля 2021 г. 22:28:42
00:19:19
Другие видео канала
What are header files in C++ ( PROGRAMMING TUTORIAL for beginners)What are header files in C++ ( PROGRAMMING TUTORIAL for beginners)How to Learn Programming and Get A Job in 2021 WITHOUT a CS degree? - CodeBeauty TalksHow to Learn Programming and Get A Job in 2021 WITHOUT a CS degree? - CodeBeauty TalksWhat is "using namespace std" and why is it considered a BAD PRACTICE? C++ Programming QuestionsWhat is "using namespace std" and why is it considered a BAD PRACTICE? C++ Programming QuestionsRelationship between Virtual Functions, Pure Virtual Functions and Abstract Classes in OOP explainedRelationship between Virtual Functions, Pure Virtual Functions and Abstract Classes in OOP explainedException handling in C++ (How to handle errors in your program?)Exception handling in C++ (How to handle errors in your program?)C++ Programming Tutorial 60 - Writing to Files with ofstreamC++ Programming Tutorial 60 - Writing to Files with ofstreamC++ POINTERS (2020) - What is a dynamic two-dimensional array? (MULTIDIMENSIONAL dynamic arrays)C++ POINTERS (2020) - What is a dynamic two-dimensional array? (MULTIDIMENSIONAL dynamic arrays)C++ POINTERS FULL COURSE Beginner to Advanced (Learn C++ Pointers in 2,5 hours)C++ POINTERS FULL COURSE Beginner to Advanced (Learn C++ Pointers in 2,5 hours)TXT Funny Moment - try not to laughTXT Funny Moment - try not to laughC++ FOR BEGINNERS (2020) - Switch/case statement, Make Calculator application PROGRAMMING TUTORIALC++ FOR BEGINNERS (2020) - Switch/case statement, Make Calculator application PROGRAMMING TUTORIALC++ FOR BEGINNERS (2020) - If/else statement, check odd/even number, flowchart PROGRAMMING TUTORIALC++ FOR BEGINNERS (2020) - If/else statement, check odd/even number, flowchart PROGRAMMING TUTORIALC++ Structures for beginners (explained in 30 minutes) + Test your programming knowledge!C++ Structures for beginners (explained in 30 minutes) + Test your programming knowledge!Abstraction explained with real-life examples and code! - C++ OOP CourseAbstraction explained with real-life examples and code! - C++ OOP CourseC++ POINTERS (2020) - How to create/change arrays at runtime? (Dynamic arrays) PROGRAMMING TUTORIALC++ POINTERS (2020) - How to create/change arrays at runtime? (Dynamic arrays) PROGRAMMING TUTORIALHow to set up VS Code for C++ and make your First Program? + How I use AI to help me code fasterHow to set up VS Code for C++ and make your First Program? + How I use AI to help me code fasterC++ POINTERS (2020) - What is a void pointer? (for beginners) PROGRAMMING TUTORIALC++ POINTERS (2020) - What is a void pointer? (for beginners) PROGRAMMING TUTORIALC++ Tutorial:  Storing records in binary files // Use structs to read and write recordsC++ Tutorial: Storing records in binary files // Use structs to read and write recordsC++ FOR BEGINNERS (2020) - ASCII Table, Program for ciphering text PROGRAMMING TUTORIALC++ FOR BEGINNERS (2020) - ASCII Table, Program for ciphering text PROGRAMMING TUTORIALC++ FUNCTIONS (2020) - What is function parameter/argument (multiple, default) PROGRAMMING TUTORIALC++ FUNCTIONS (2020) - What is function parameter/argument (multiple, default) PROGRAMMING TUTORIALSMART POINTERS in C++ (for beginners in 20 minutes)SMART POINTERS in C++ (for beginners in 20 minutes)
Яндекс.Метрика