C++ Tutorial for Beginners 42 -Create a Text File and Write in It

preview_player
Показать описание
Code used in this video :
★★★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!

Input/output with files - C++
Creating and writing to a file
Creating/Writing File (Win32)
Changable filename based on user input
Reading and Writing to a txt file.
fstream -- writing to files - C++ Forum
How to: Write a Text File
save - How to create text file in c++?
how to create a txt file in c++
c++ reading from txt file
Reading lines from txt file
Reading Line by Line from Text File into
Saving and Loading from a text file
Reading and Writing to a txt file.
php create text file and write to it
vbscript create text file and write to it
java create text file and write
Рекомендации по теме
Комментарии
Автор

This is why I love Indian guys I just have 30 muinte and the exam will start and now I understand.
Sorry for my English

ahmedababneh
Автор

finally a freaking awesome teacher for C++!

thank you!

djblast
Автор

To all Linux Users:
in Linux with codeblocks you have to look to your project folder, NOT to /bin/Debug ;)

LinuxGuides
Автор

Thanks, I had a hard time understanding this and now I get it.

stelaidrizi
Автор

Thanks 😊 I couldn't understand this at all now I can

piumiwijenayake
Автор

Can't we use read(), write() functions to write into a file or are those for reading and writing into files from classes?

vanirudh
Автор

sure but what if i need to write multiple lines using variables

brainofeu
Автор

I found a game engine that has proprietary image format. I need to use cpp to convert my files in that format. Should i do almost like this? I'm not good at cpp.

creeper
Автор

Thank you for making it understandable.
Good job!

TasosEG
Автор

Hey, what's a good way to find the files you have created?

jdq
Автор

How do we display to console for key entry and output to txt at same time?

solartorium
Автор

Amazing .
So How to create that text file in special folder like %AppData%\MyFolder?

oscarlopiez
Автор

Thanks for the video it's very well done and explanatory

Boltstrike
Автор

+ProgrammingKnowledge
What if I add a simple addition inside that program then the answer will show in text file, is it possible sir? Thank you in advance 😊😊

jasonrose
Автор

it seems you are knowledgeable about this. can you help me create a c++ program that allows me to input output and edit it.

erlemiranda
Автор

isn't the whole point of using namespace to avoid std::cin syntax ?

FreeTrial
Автор

How to get the output of any c program into a txt file?

arshitaanchaliya
Автор

for some reason newlines don't show up in text files. Maybe it's just me. But it seems to work in Dot.OUT files...
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main()
{
fstream file("code.out", std::fstream::out); // if i were to put .text instead of .out it would not work ;( why?

string write;
getline(cin, write);
file << write << '\n';
file.close();
}

powerToYourself
Автор

But I just have a question. Is the file you mean a directory or what?

blueberry