C++ Tutorial for Beginners 29 - Binary Files in C++ | Structure In Binary File I/O

preview_player
Показать описание
Welcome to this course on C++ Tutorial for Beginners. In this video we will see How to use File I/O in C++.
Using Input/Output Files
stream - a sequence of characters interactive (iostream)
cin - input stream associated with keyboard.
cout - output stream associated with display
file (fstream)
 ifstream - defines new input stream (normally associated with a file).
 ofstream - defines new output stream (normally associated with a file).

C++ is general purpose, compiled, object-oriented programming language and its concepts served as the basis for several other languages such as Java, Python, Ruby, Perl etc.

The goal of this course is to provide you with a working knowledge of C++. We'll start with the basics, including syntax, operators, loops, and functions. This Course will explain you how to use data structures and create your own Functions. This Course will show you the details of the powerful object and template systems so you can create useful classes and objects.

#ProgrammingKnowledge #CppTutorial #CPPprogramming #Structures #Struct
★★★Top Online Courses From ProgrammingKnowledge ★★★

★★★ Online Courses to learn ★★★

★★★ Follow ★★★

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
Комментарии
Автор

good. you should use reinterpret_cast rather than C-style cast. file.read(reinterpret_cast<char*>(&p), sizeof(p));
also you should never read a non-initialized object because it yields Undefined Behavior:
int p;
cout << p;// UB
* usually you don't need to close file explicitly, the destructor foes it for you. you only need that if you want to save changes then you need to use the same stream for another file or even for the same for another reason.

itachiuchiwa
Автор

Thank you. I was trying to acces ements of a class while reading. Now I understand that it really works.

vinniciusrosa
Автор

Dude i feel like this is the most underrated channel because most of the people watches it subscribes it but never visit again to watch regularly. Why? Maybe because of no catchy thumbnail?

saadmahmood
Автор

Thankyou. I've wasted so much time on other tutorials that didn't work. This one worked :)
Are you familiar with game loops and proper frame capping that doesn't fry my CPU ?

haroldmcbroom
Автор

Hi Very Good Tutorials, please can you help, I'm trying to save data in .dat file, my program can save data in .txt file but i also want to save it in .dat file plzzz sir can you help me do it???

Shinesfox
Автор

buenas men gustaria abrir y ejecutar un archivo binario ya hecho por fa, buen video

LettyneD
Автор

Such a low volume -_- Tatti microphone.

NoBakwas
Автор

WHY ARE ONLY INDIAN TUTORIALS WITH BROKEN

zsolttulit