Buckys C++ Programming Tutorials - 64 - Working with Files

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 208

  • @flow1465
    @flow1465 8 ปีที่แล้ว +356

    tuna and bucky still a better love story than twilight

  • @noahleveille366
    @noahleveille366 6 ปีที่แล้ว +11

    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

    • @souljarohill8795
      @souljarohill8795 2 ปีที่แล้ว

      In 2022 and ive looked at his videos a ton. I can say the same thing, he would be a great proffessor for c++.

  • @Runeite51
    @Runeite51 12 ปีที่แล้ว +11

    This is definitely my favorite tutorial. Always wanted to learn how this was done.

  • @isrj01
    @isrj01 4 ปีที่แล้ว +3

    6 years later Bucky still helps me with his videos

  • @onewhobeasts
    @onewhobeasts 10 ปีที่แล้ว +46

    bucky and tuna... still a better love story than twilight.

  • @andyee3273
    @andyee3273 7 ปีที่แล้ว +66

    i said "Pretty Cool huh" after he read the line in the text file before him..

  • @sereyvathanameng6467
    @sereyvathanameng6467 3 ปีที่แล้ว +2

    I love tuna and tuna loves me - Bucky
    Pretty cool, huh

  • @lespaul2664
    @lespaul2664 10 ปีที่แล้ว +10

    Far better and easier than working files in C :D

  • @JIMITSHAH
    @JIMITSHAH 12 ปีที่แล้ว

    bucky you are best teacher I have ever had.

  • @MattCrocco
    @MattCrocco 11 ปีที่แล้ว +4

    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.

  • @Grey52542
    @Grey52542 7 ปีที่แล้ว +1

    You don't know how much I love you.

  • @x2blader
    @x2blader 5 ปีที่แล้ว +2

    "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

  • @garrettbarton5240
    @garrettbarton5240 5 ปีที่แล้ว

    Bucky your videos give me strength. Your tutorials are fun to watch

  • @GameOverBeats
    @GameOverBeats 10 ปีที่แล้ว +1

    I assume this is how cfg files work in a lot of games. Thank you!

  • @brandlax
    @brandlax 12 ปีที่แล้ว

    I think for beginners, keeping things real simple is the best way to go.

  • @itskiefer
    @itskiefer 13 ปีที่แล้ว

    Bucky, this is why I love you.

  • @puffbluesam021
    @puffbluesam021 10 ปีที่แล้ว

    File Text Database!! This helps a lot in Data Structures, Sir Bucky! Thank you so much!!!!

  • @Bookishbroccoli1
    @Bookishbroccoli1 11 ปีที่แล้ว

    Thank you! I did not get this file thing when my professor was going over this.

  • @christopherkim3955
    @christopherkim3955 6 ปีที่แล้ว +1

    wow. this was really helpful. Thanks!

  • @PrasannDatta
    @PrasannDatta 12 ปีที่แล้ว

    thanx bro you saved me from getting fail in my practical exam

  • @Impulse_Photography
    @Impulse_Photography 5 ปีที่แล้ว

    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.

  • @zarifahmed1024
    @zarifahmed1024 8 ปีที่แล้ว +2

    you what Bucky.. I love u. u just saved me!

  • @vishesh7362
    @vishesh7362 2 ปีที่แล้ว

    you are awesome buckyyyyy,what a lec

  • @diazdaiz
    @diazdaiz 6 ปีที่แล้ว

    i press like button because of this 5:23

  • @Trackman2007
    @Trackman2007 12 ปีที่แล้ว

    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..

  • @toasterv4205
    @toasterv4205 6 ปีที่แล้ว +4

    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

  • @Runemisi
    @Runemisi 13 ปีที่แล้ว

    Thank you so much!!! Can't wait for the blender tutorials :)

  • @kayleenmedina236
    @kayleenmedina236 5 ปีที่แล้ว

    God Bless You. You are awesome.

  • @mustafasaleem7468
    @mustafasaleem7468 7 ปีที่แล้ว

    Preety cool huh>>>>Loved it

  • @fugger02
    @fugger02 11 ปีที่แล้ว

    Bucky, thank you for your tutorials. Great stuff!!

  • @zelda66661
    @zelda66661 12 ปีที่แล้ว

    wow, you are indeed appreciated. THANKS

  • @satadhi
    @satadhi 10 ปีที่แล้ว

    top class explanation

  • @DavidDilson
    @DavidDilson 13 ปีที่แล้ว

    you are way more than cool !!!

  • @tahirnawaz9821
    @tahirnawaz9821 3 ปีที่แล้ว

    Thanks sir you are very nice teacher

  • @TusharSharmatushar13992
    @TusharSharmatushar13992 8 ปีที่แล้ว +14

    Pretty cool huh :P

  • @moazelsawaf2000
    @moazelsawaf2000 5 ปีที่แล้ว

    Thanks a lot bucky ❤

  • @pirlosful
    @pirlosful 12 ปีที่แล้ว

    man u r amazing !!

  • @benpicko
    @benpicko 13 ปีที่แล้ว +3

    I literally shat myself when I saw tuna

  • @anshumans1174
    @anshumans1174 4 ปีที่แล้ว

    Literal god

  • @Pages_Perfected
    @Pages_Perfected 3 ปีที่แล้ว

    Bucky
    u r awesome

  • @JakobRobert00
    @JakobRobert00 13 ปีที่แล้ว

    this is very useful
    then you could create a highscore.txt file in a game so that the highscore is stored. very useful

  • @AllenDelorie
    @AllenDelorie 6 ปีที่แล้ว

    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.

  • @sonysalma7274
    @sonysalma7274 11 ปีที่แล้ว

    Pretty cool!

  • @zachcantwell
    @zachcantwell 11 ปีที่แล้ว +1

    I love tuna and tuna loves me!

  • @MrHartl1ey
    @MrHartl1ey 13 ปีที่แล้ว

    Loving these tuts will you be doing tuts on how to make programs ?

  • @joshuagabel1717
    @joshuagabel1717 3 ปีที่แล้ว

    Alternative and simpler way to write,
    ofstream buckyFile;
    buckFile.open("tuna.txt");
    Is,
    ofstream buckyFile ("tuna.txt");

  • @akashghosh4766
    @akashghosh4766 7 ปีที่แล้ว

    Bucky loves Tuna

  • @Tranzdog1
    @Tranzdog1 5 ปีที่แล้ว

    tuna and bucky love story is still going strong, twilight has broken up

  • @TheGuyBehindY0u
    @TheGuyBehindY0u 8 ปีที่แล้ว +2

    when you say "Huh" after "Pretty Cool" you sound like Elvis

  • @dannyc.8696
    @dannyc.8696 12 ปีที่แล้ว

    7:47
    Yeah... WoW is so much worth the time

  • @pranay_patil
    @pranay_patil 10 ปีที่แล้ว

    Awesome..!!

  • @furrysophie8997
    @furrysophie8997 10 ปีที่แล้ว +4

    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.

    • @Howtodothatshit
      @Howtodothatshit 10 ปีที่แล้ว

      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.

    • @furrysophie8997
      @furrysophie8997 10 ปีที่แล้ว +1

      Not necessarily. People are watching it cause they don't fully know C++, right?

    • @Howtodothatshit
      @Howtodothatshit 10 ปีที่แล้ว

      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.

  • @realtalkjames2408
    @realtalkjames2408 5 ปีที่แล้ว

    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

  • @alldogsgotoheaven1533
    @alldogsgotoheaven1533 4 ปีที่แล้ว

    Thank you Bucky...(Here after watching 12345678910 videos of indian programmers and the result of course = 0)

  • @rbsupercool
    @rbsupercool 11 ปีที่แล้ว

    tuna is pretty useful in bucky's tutorials huh!!!!

  • @sudhirsjce
    @sudhirsjce 11 ปีที่แล้ว +1

    pretty cool huh!

  • @Skulltroxx
    @Skulltroxx 3 ปีที่แล้ว

    oh boy, it's been a decade now!

  • @hachihao1604
    @hachihao1604 7 ปีที่แล้ว

    Much easier than C, maybe file is the only thing that c++ is easier than C :)

  • @xGodzAssassin
    @xGodzAssassin 13 ปีที่แล้ว

    @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

  • @ovidiugobrrrr8171
    @ovidiugobrrrr8171 3 ปีที่แล้ว

    imma store my essay into a variable

  • @68ncom86
    @68ncom86 11 ปีที่แล้ว

    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!");

  • @kairu_b
    @kairu_b 2 ปีที่แล้ว

    Noice

  • @izzyxyoung
    @izzyxyoung 11 ปีที่แล้ว

    yeeeeee

  • @qazijahangeerarifali7163
    @qazijahangeerarifali7163 8 ปีที่แล้ว +1

    Can you please add a video for read, search & update file?
    Thank You.

  • @JrIcify
    @JrIcify 10 ปีที่แล้ว +1

    Is it okay to make the file object always named the same thing as the file saved to the disk?

  • @カラスKarasu
    @カラスKarasu 12 ปีที่แล้ว +1

    Me:
    10PM - "OK, I'll watch this tutorial and then go to sleep."
    2AM ----"Who needs sleep? :3"

  • @KW-dg6fs
    @KW-dg6fs 7 ปีที่แล้ว +3

    How did you set your directory to desktop?

  • @AmrGunners
    @AmrGunners 7 ปีที่แล้ว +1

    pretty cool ha

  • @amitgaurav9095
    @amitgaurav9095 7 ปีที่แล้ว +1

    How to store the file at desired location

  • @fernandojubany687
    @fernandojubany687 2 ปีที่แล้ว

    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

  • @shoshoar6414
    @shoshoar6414 10 ปีที่แล้ว

    Thank U :))))))))))))))))))))))))))

  • @Cadsjr284
    @Cadsjr284 11 ปีที่แล้ว +1

    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?

  • @1200steven
    @1200steven 12 ปีที่แล้ว

    Man i almost finished with all the turtorials.

  • @skitty_replays
    @skitty_replays 5 ปีที่แล้ว

    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?

  • @dougarmstrong7587
    @dougarmstrong7587 10 ปีที่แล้ว

    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?

  • @steve122288
    @steve122288 8 ปีที่แล้ว +1

    is the

    • @steve122288
      @steve122288 8 ปีที่แล้ว

      +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...

  • @mezirezi1
    @mezirezi1 5 ปีที่แล้ว

    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.

  • @thegamingruler1996
    @thegamingruler1996 12 ปีที่แล้ว

    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

  • @noideayo
    @noideayo 13 ปีที่แล้ว

    @MrHartl1ey You mean applications with a GUI?

  • @oscarcastanedamunoz
    @oscarcastanedamunoz 9 ปีที่แล้ว

    how do you paste an image from your clipboard into a png file using c++. Im using windows.

  • @matthewcapobianco9332
    @matthewcapobianco9332 10 ปีที่แล้ว

    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

  • @archentity
    @archentity 11 ปีที่แล้ว

    Other C++ tutorials act like this is forbidden knowledge.

  • @FrobiFrohbaer
    @FrobiFrohbaer 11 ปีที่แล้ว

    did i get it right that ofstream -> output to file-stream and ifstream -> input to file-stream??

  • @bobdole8324
    @bobdole8324 10 ปีที่แล้ว

    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?

  • @amirrazaq6367
    @amirrazaq6367 8 ปีที่แล้ว +1

    can we save ??
    keyboard key strokes....

    • @Impulse_Photography
      @Impulse_Photography 5 ปีที่แล้ว

      They have ascii values - - you can save those values

  • @gardenstateboss
    @gardenstateboss 10 ปีที่แล้ว

    5 people don't like tuna & tuna doesn't like them!!

  • @coldfreezerman
    @coldfreezerman 10 ปีที่แล้ว

    it always overwrites the text that i did, how do i prevent that from happening

  • @sammy_xxx
    @sammy_xxx 8 ปีที่แล้ว +1

    Could you use this to add a database?

  • @imlolly6707
    @imlolly6707 8 ปีที่แล้ว +1

    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!

    • @kwstassketo
      @kwstassketo 8 ปีที่แล้ว

      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)

  • @anotherone10
    @anotherone10 13 ปีที่แล้ว

    +1

  • @UnwrapZindagi
    @UnwrapZindagi 6 ปีที่แล้ว

    2M subs, pretty cool huh? XD XD XD

  • @handsomebooger8726
    @handsomebooger8726 6 ปีที่แล้ว

    So what happens if i run it more than once?

  • @RabinGhimire123
    @RabinGhimire123 8 ปีที่แล้ว

    when you create a file and if there is another file with the same name will it over write the previous file ?

  • @awuuwa
    @awuuwa 4 ปีที่แล้ว

    good video, but how can I create directories for the files to be in

  • @bermudatriangle94
    @bermudatriangle94 3 ปีที่แล้ว

    where can i get bucky's web tutorials???

  • @p3wx4
    @p3wx4 7 ปีที่แล้ว

    where do I find the file just created?

  • @Lam-nx5sm
    @Lam-nx5sm 3 ปีที่แล้ว

    I wish someone could love me as much as you love tuna

  • @hexmedi
    @hexmedi 12 ปีที่แล้ว

    @mdwael Your teacher is learning from Bucky probably and doesn't know why they do that either. True story bro

  • @HASEEBJANE
    @HASEEBJANE 6 ปีที่แล้ว

    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.....

  • @cennessiostation2410
    @cennessiostation2410 10 ปีที่แล้ว

    I keep getting errors in dev-c++ ofstream file;