New programming student and watching these videos. Bucky would make a great teacher, really easy to understand and digest videos, kinda funny and it’s all told in laymen’s terms for the most part. Great series for new programmers
This is why I love Bucky, I spend a few hours watching his videos and then I end up on a project branching off of this that I can use in the future that takes hours. In this instance I decided, hell I will make a FileHandler class to write lines, read lines and terminate. This resulted in a very nice class that can read words, lines and the number of lines or words as well as terminate the streams for me and apply a TERMINATOR string to the file if needed. Nothing compared to my Java Projects (My main language) but its a start. I already spent hours creating a nice to use, accurate (though Console based) Calculator and Interest Calculator. The same thing happened when I first learned Java through Bucky! He is a great teacher, I recommend him as supplementary guides when I teach people Java or C# or any of the Web-based Languages.
Note at 7:05 "It's good programming practice to close your files," which is very true. However, it is just as true to create your own file and not allow things, like creating a file, to happen behind the scene where you do not know it is happening or you have no control of its creationg. You should always create your own file, then read / write to it, and finally close it when you are done with that resource. If you need it later on in your program you can re-open it again.
or u can do: ifstream file("tuna.txt"); //for reading from file ofstream outfile("outtuna.txt"); //for writing to file and u don't need to open, or close it , it will work without those lines of cod
Just discovered in the bad way, that ofstream WIPES OUT ALL CONTENT OF THE OPENED FILE. Now I'm trying to learn how to open a file to edit without destroying it's contents.... Still, great series, very easy to follow.
I think he explained it kind of bad for people that saw this for their first time. ofstream is a datatype that means output file stream. If the file does not exist, it will be created. The "o" does not mean object. ifstream is a datatype that means input file stream. If the file does not exist, you will go into the fail state and your program will terminate if specified or it just won't compile.
Not true. Any person with a little common sense should know that the o stands for output and not a way to create an object. And if you're working with C++ you should have common sense, so no point of even explaining that it stands for output.
I get what you mean, but anyhow you know what iostream is, input & output stream. So adding 2 + 2, you should be able to figure it out with a little common sense. I haven't yet seen 1 person complain about not knowing it stood for input & output.
For my 2019 tutorial c++ junkies , the getline() function is better than cout if you have multiple words and phrases in your string: #include #include #include using namespace std; int main() { string input; ofstream cmdFile; cmdFile.open("tuna.txt"); cmdFile
@mdwael this is pretty much a short way to take a new line /n is the same and taking a new line in your code when you put this after your test it will take a new line
hi bucky, i try to code this program, but i can't see the file in my computer. I'm using Mac and a code runner developer tools. Does it make different?
i can include but cannot use 'ofstream' for some reason. It doesn't show up in the visual studio intelliSense either. Any suggestions, person reading this?
+steve122288 hmm wait a minute.. it would appear iostream is overloading the binary shift operator? It would appear it becomes known as its own operator when used with iostream called insertion operator...
Hey Bucky, how do you; add, update, search, delete, and display from a text file. Could you please make a quick video to demonstrate in addition with case/If statements.
I keep getting errors Error 1 error C3867: 'std::basic_ofstream::close': function call missing argument list; use '&std::basic_ofstream::close' to create a pointer to member c:\users\class2018\documents\visual studio 2012\projects\consoleapplication20\consoleapplication20\consoleapplication20.cpp 15 1 ConsoleApplication20
Bucky Thanks for the videos! Can you help show how to save to a filepath in windows for example "C:/Users/RandomUsername/Desktop/Filename" I dont know how to get the user name to change for multiple computers! Any advice?
Would you have any tips on making it more difficult to cheat (like doing some kind of encryption or working with multiple files etc) That would be EPIC!
Hello brother.There is a way to kind off encrypt file information.I dont know if c++has that option but binary files is something you should defenitely check.Something like binary file handling i guess would show you what i am reffering to and its pretty much the same handling as normal txt files(its defenitely a part of java who is also object oriented too so id guess its part of c++ too)
hello friend ! I am student of computer science and learning c++ . when ever i face a problem i will search on youtube with your name solution of every problem is avail here but now i have a problem on which i cant find solution on any site . the problem is that : i have a file (.txt) and there is a lot of stuff inside this file for example mac address is saved in this file and i want to get mac address in variable (mac address is in 15th line after 20 words) so how can i get this value in my variable ; kindly guide me . I shall be very thankful to you if you help me.....
tuna and bucky still a better love story than twilight
Watermelon comes next
same profile picture!!
name a more iconic duo
Bucky & Bacon.
@@geismos4746 pretty cool huh
New programming student and watching these videos. Bucky would make a great teacher, really easy to understand and digest videos, kinda funny and it’s all told in laymen’s terms for the most part.
Great series for new programmers
In 2022 and ive looked at his videos a ton. I can say the same thing, he would be a great proffessor for c++.
This is definitely my favorite tutorial. Always wanted to learn how this was done.
6 years later Bucky still helps me with his videos
bucky and tuna... still a better love story than twilight.
i said "Pretty Cool huh" after he read the line in the text file before him..
woah
I love tuna and tuna loves me - Bucky
Pretty cool, huh
Far better and easier than working files in C :D
bucky you are best teacher I have ever had.
This is why I love Bucky, I spend a few hours watching his videos and then I end up on a project branching off of this that I can use in the future that takes hours.
In this instance I decided, hell I will make a FileHandler class to write lines, read lines and terminate.
This resulted in a very nice class that can read words, lines and the number of lines or words as well as terminate the streams for me and apply a TERMINATOR string to the file if needed. Nothing compared to my Java Projects (My main language) but its a start. I already spent hours creating a nice to use, accurate (though Console based) Calculator and Interest Calculator.
The same thing happened when I first learned Java through Bucky! He is a great teacher, I recommend him as supplementary guides when I teach people Java or C# or any of the Web-based Languages.
You don't know how much I love you.
"health happiness and hunger" don't starve. your tutorials are great and very helpful as you explain why things are needed and what they mean
Bucky your videos give me strength. Your tutorials are fun to watch
I assume this is how cfg files work in a lot of games. Thank you!
I think for beginners, keeping things real simple is the best way to go.
Bucky, this is why I love you.
File Text Database!! This helps a lot in Data Structures, Sir Bucky! Thank you so much!!!!
Thank you! I did not get this file thing when my professor was going over this.
wow. this was really helpful. Thanks!
thanx bro you saved me from getting fail in my practical exam
Note at 7:05 "It's good programming practice to close your files," which is very true. However, it is just as true to create your own file and not allow things, like creating a file, to happen behind the scene where you do not know it is happening or you have no control of its creationg. You should always create your own file, then read / write to it, and finally close it when you are done with that resource. If you need it later on in your program you can re-open it again.
you what Bucky.. I love u. u just saved me!
you are awesome buckyyyyy,what a lec
i press like button because of this 5:23
1 of the best things about Sonic on Sega was that i couldn't save my game. So it was so much more interesting to get to the next level..
or u can do:
ifstream file("tuna.txt"); //for reading from file
ofstream outfile("outtuna.txt"); //for writing to file
and u don't need to open, or close it , it will work without those lines of cod
Thanks! :)
Thank you so much!!! Can't wait for the blender tutorials :)
God Bless You. You are awesome.
Preety cool huh>>>>Loved it
Bucky, thank you for your tutorials. Great stuff!!
wow, you are indeed appreciated. THANKS
top class explanation
you are way more than cool !!!
Thanks sir you are very nice teacher
Pretty cool huh :P
:)
:{)
Thanks a lot bucky ❤
man u r amazing !!
I literally shat myself when I saw tuna
Literal god
Bucky
u r awesome
this is very useful
then you could create a highscore.txt file in a game so that the highscore is stored. very useful
Just discovered in the bad way, that ofstream WIPES OUT ALL CONTENT OF THE OPENED FILE. Now I'm trying to learn how to open a file to edit without destroying it's contents.... Still, great series, very easy to follow.
Pretty cool!
I love tuna and tuna loves me!
Loving these tuts will you be doing tuts on how to make programs ?
Alternative and simpler way to write,
ofstream buckyFile;
buckFile.open("tuna.txt");
Is,
ofstream buckyFile ("tuna.txt");
Bucky loves Tuna
tuna and bucky love story is still going strong, twilight has broken up
when you say "Huh" after "Pretty Cool" you sound like Elvis
7:47
Yeah... WoW is so much worth the time
Awesome..!!
I think he explained it kind of bad for people that saw this for their first time. ofstream is a datatype that means output file stream. If the file does not exist, it will be created. The "o" does not mean object. ifstream is a datatype that means input file stream. If the file does not exist, you will go into the fail state and your program will terminate if specified or it just won't compile.
Not true. Any person with a little common sense should know that the o stands for output and not a way to create an object.
And if you're working with C++ you should have common sense, so no point of even explaining that it stands for output.
Not necessarily. People are watching it cause they don't fully know C++, right?
I get what you mean, but anyhow you know what iostream is, input & output stream.
So adding 2 + 2, you should be able to figure it out with a little common sense. I haven't yet seen 1 person complain about not knowing it stood for input & output.
For my 2019 tutorial c++ junkies , the getline() function is better than cout if you have multiple words and phrases in your string:
#include
#include
#include
using namespace std;
int main()
{
string input;
ofstream cmdFile;
cmdFile.open("tuna.txt");
cmdFile
Thank you Bucky...(Here after watching 12345678910 videos of indian programmers and the result of course = 0)
tuna is pretty useful in bucky's tutorials huh!!!!
pretty cool huh!
oh boy, it's been a decade now!
Much easier than C, maybe file is the only thing that c++ is easier than C :)
@mdwael this is pretty much a short way to take a new line /n is the same and taking a new line in your code when you put this after your test it will take a new line
imma store my essay into a variable
You don't need fstream to work with files;
an alternative way:
#include stdlib
Somewhere in your main/function:
system("Type bat/cmd code here!");
Noice
yeeeeee
Can you please add a video for read, search & update file?
Thank You.
Is it okay to make the file object always named the same thing as the file saved to the disk?
Me:
10PM - "OK, I'll watch this tutorial and then go to sleep."
2AM ----"Who needs sleep? :3"
Can relate
How did you set your directory to desktop?
pretty cool ha
How to store the file at desired location
On this Buckys tutorial # 64, how could you specify explicitly a path for the file to be written and later read from? Thanks a lot
Thank U :))))))))))))))))))))))))))
hi bucky, i try to code this program, but i can't see the file in my computer. I'm using Mac and a code runner developer tools. Does it make different?
Man i almost finished with all the turtorials.
i can include but cannot use 'ofstream' for some reason. It doesn't show up in the visual studio intelliSense either. Any suggestions, person reading this?
I tried opening the text file and a bunch of explorer windows started opening, but the file itself didn't. How can I remedy this?
is the
+steve122288 hmm wait a minute.. it would appear iostream is overloading the binary shift operator? It would appear it becomes known as its own operator when used with iostream called insertion operator...
Hey Bucky, how do you; add, update, search, delete, and display from a text file. Could you please make a quick video to demonstrate in addition with case/If statements.
well im not saying use QT libraries im saying use standard cpp libaries in QT IDE because QT IDE is way better than code blocks
@MrHartl1ey You mean applications with a GUI?
how do you paste an image from your clipboard into a png file using c++. Im using windows.
I keep getting errors
Error 1 error C3867: 'std::basic_ofstream::close': function call missing argument list; use '&std::basic_ofstream::close' to create a pointer to member c:\users\class2018\documents\visual studio 2012\projects\consoleapplication20\consoleapplication20\consoleapplication20.cpp 15 1 ConsoleApplication20
Other C++ tutorials act like this is forbidden knowledge.
did i get it right that ofstream -> output to file-stream and ifstream -> input to file-stream??
Bucky Thanks for the videos! Can you help show how to save to a filepath in windows for example "C:/Users/RandomUsername/Desktop/Filename" I dont know how to get the user name to change for multiple computers! Any advice?
can we save ??
keyboard key strokes....
They have ascii values - - you can save those values
5 people don't like tuna & tuna doesn't like them!!
it always overwrites the text that i did, how do i prevent that from happening
Could you use this to add a database?
Would you have any tips on making it more difficult to cheat (like doing some kind of encryption or working with multiple files etc) That would be EPIC!
Hello brother.There is a way to kind off encrypt file information.I dont know if c++has that option but binary files is something you should defenitely check.Something like binary file handling i guess would show you what i am reffering to and its pretty much the same handling as normal txt files(its defenitely a part of java who is also object oriented too so id guess its part of c++ too)
+1
2M subs, pretty cool huh? XD XD XD
So what happens if i run it more than once?
when you create a file and if there is another file with the same name will it over write the previous file ?
good video, but how can I create directories for the files to be in
where can i get bucky's web tutorials???
where do I find the file just created?
I wish someone could love me as much as you love tuna
@mdwael Your teacher is learning from Bucky probably and doesn't know why they do that either. True story bro
hello friend !
I am student of computer science and learning c++ . when ever i face a problem i will search on youtube with your name
solution of every problem is avail here but now i have a problem on which i cant find solution on any site .
the problem is that : i have a file (.txt) and there is a lot of stuff inside this file for example mac address is saved in this file and i want to get mac address in variable (mac address is in 15th line after 20 words) so how can i get this value in my variable ;
kindly guide me .
I shall be very thankful to you if you help me.....
I keep getting errors in dev-c++ ofstream file;