C++ File Input and Output
HTML-код
- Опубликовано: 9 окт 2021
- In this video you will learn to take in input from a file and output to a file using the fstream library in C++.
Production: Shmeowlex
Graphics : Shmeowlex
Editing: Shmeowlex
#C++ #Programming #ComputerScience Наука
That was a Great explanation man, thanks. You saved me a lot of time and effort.
Glad I can help :)
Tried this code on Replit for Android and it works. Thanks!
Glad I can help :)
Thanks man, you helped me a lot.
Glad I could help!
Nice. But i dont think you should exit with a return 0. You could return with -1 or EXIT_FAILURE
I need help sir, I am using a MacBook Pro and I can't open these files or create one for that matter, I would appreciate your help
Thanks! It helped me a lot.
Glad it helped!
is there a function build in or something so i aim at certain string/line of txt file with fstream ?
No, you would need to read through the file
Great explanation ! thank you
You are welcome!
Great explanation sir. 💐🌷🌹🥀🌻🌼
Glad I can help :)
Great video
Glad you enjoyed it
well explained way better then my professor fr
Glad I could help!
bro u r amazing
Glad I can help :)
I have a question. What if your input and output files are the same? I mean like the results of your input has to be added to the same file?
you would need to read everything in from the file into arrays, then output everything with the appended data.
I have one question: after making the file, where does it get stored? I am using an arduino R3 and a SD card as my source of storage, how do I move the file to an external drive?
I am not familiar with the arduino platform unfortunately :(
great video
Glad you enjoyed it
Why does the info get deleted when I run the program again even though I wrote endl at the end? and how do I prevent that from happening?
output files get deleted and recreated every time you open them.
Very helpful
Glad to help.
Is there a need to check if the output file exists? Because from what I know, the output file will be created automatically in the project folder if it does not exist
If the path to the file is invalid it will fail (i.e. if you wanted to place your output in an output directory but the output directory was not created yet).
@@shmeowlex Understood, thanks!
why are you using return 0 on if statement, i cannot get the logic?
To terminate the program.