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
  • НаукаНаука

Комментарии • 38

  • @faresawachi3305
    @faresawachi3305 Год назад +1

    That was a Great explanation man, thanks. You saved me a lot of time and effort.

  • @azeez8399
    @azeez8399 Год назад

    Tried this code on Replit for Android and it works. Thanks!

  • @mihai3043
    @mihai3043 2 года назад +6

    Thanks man, you helped me a lot.

    • @shmeowlex
      @shmeowlex  11 месяцев назад

      Glad I could help!

  • @DavisTibbz
    @DavisTibbz 9 месяцев назад +2

    Nice. But i dont think you should exit with a return 0. You could return with -1 or EXIT_FAILURE

  • @priscusemmanuel8403
    @priscusemmanuel8403 2 года назад +2

    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

  • @Itisnot2late
    @Itisnot2late Год назад +5

    Thanks! It helped me a lot.

  • @Evizzo
    @Evizzo 2 года назад

    is there a function build in or something so i aim at certain string/line of txt file with fstream ?

    • @shmeowlex
      @shmeowlex  11 месяцев назад

      No, you would need to read through the file

  • @MementoMoriMementoVivere881
    @MementoMoriMementoVivere881 Год назад +1

    Great explanation ! thank you

  • @chidanandskusur4054
    @chidanandskusur4054 Год назад +3

    Great explanation sir. 💐🌷🌹🥀🌻🌼

  • @Primer9
    @Primer9 Год назад +1

    Great video

  • @shushe3953
    @shushe3953 Год назад

    well explained way better then my professor fr

    • @shmeowlex
      @shmeowlex  11 месяцев назад

      Glad I could help!

  • @Ali_X20
    @Ali_X20 Год назад +1

    bro u r amazing

  • @chefskiss651
    @chefskiss651 Год назад

    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?

    • @shmeowlex
      @shmeowlex  Год назад

      you would need to read everything in from the file into arrays, then output everything with the appended data.

  • @Little_G_Dizzle
    @Little_G_Dizzle Год назад

    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?

    • @shmeowlex
      @shmeowlex  Год назад

      I am not familiar with the arduino platform unfortunately :(

  • @timog7358
    @timog7358 3 месяца назад

    great video

    • @shmeowlex
      @shmeowlex  2 месяца назад

      Glad you enjoyed it

  • @1..1..1..1H
    @1..1..1..1H 11 месяцев назад

    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?

    • @shmeowlex
      @shmeowlex  11 месяцев назад

      output files get deleted and recreated every time you open them.

  • @lemniscate23
    @lemniscate23 10 месяцев назад

    Very helpful

  • @elaine3867
    @elaine3867 11 месяцев назад

    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

    • @shmeowlex
      @shmeowlex  11 месяцев назад +1

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

    • @elaine3867
      @elaine3867 11 месяцев назад

      @@shmeowlex Understood, thanks!

  • @mr.shredder5430
    @mr.shredder5430 4 месяца назад

    why are you using return 0 on if statement, i cannot get the logic?

    • @shmeowlex
      @shmeowlex  2 месяца назад

      To terminate the program.