Buckys C++ Programming Tutorials – 67 – Reading Custom File Structures

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

35 responses to “Buckys C++ Programming Tutorials – 67 – Reading Custom File Structures”

  1. Jahanzaib Shahid Avatar

    in my program the compiler read only first line why ??

    #include <iostream>
    #include <conio.h>
    #include <fstream>
    using namespace std;

    void main()
    {
    ifstream csfile("player.txt");

    int id;
    char name[50];
    float money;

    while (csfile >> id >> name >> money)
    {
    cout << id << name << money << endl;
    }
    getch();
    }

  2. Nurisha Hania Kamarudin Avatar

    I have problem when display the data. Someone can you help me? I need help. When display the data , the data display twice .

  3. Riasat Zaman Avatar

    When I run my program, it only shows the last line. It's skipping the first few lines. Anyone knows why??Please!

  4. Top Ten Avatar

    Thank You so much <3

  5. Salar Delavar Ghashghaei Avatar

    thanks a lot. it was very helpful for me and I got my answer which I couldn't find the solution. I really appreciate it.

  6. sophia theresa Avatar

    hey, everyone!!! so in line 13, the values are stored?
    so if I want to call the information to find the average of the bank account numbers I can use "double money" <- because the values are stored in it already right?
    can someone help me, please!!!
    I hope you understand

  7. Thomas D Avatar

    why is it that when i run my program nothing is appearing other than the press any key to continue button. I am doing everything like you and it still is not working almost like it can't locate the file or something.

  8. Hamza Shahid Avatar

    Bucky ! can we use ofstream and ifstream in same program

  9. Hamidur Rahman Avatar

    How to make sounds on Mac using Beep ( )

  10. Kalash Shah Avatar

    Thank You Very Very much
    You made me learn file handling very easily

  11. Benjamin Henry Avatar

    Could you use this to write a list of infix equations, then read it into an infix to post-fix conversion algorithm?

  12. Benjamin Henry Avatar

    You really do a damn god job at your tutorials!

  13. boris said Avatar

    Why does nothing appear when I run the program?

  14. Sucheta Iyer Avatar

    What if one field has null value? How to ignore that and read next value in correct variable?
    Index Name Point Value
    1 Sam 0.2
    2 0.9
    Ron B. 0.4
    4 Soy
    How to read the 3 colums correctly into respective variable? And what if one field has space?

  15. SIMuTech Avatar

    for(var b=0,c=0;b<this.C.length&&c<a.length;b++)

  16. Pete the Paper Boat Avatar

    it only reads the last line for me

  17. Pranay Raju Avatar

    how do you do the same when the text file contains commas (,) instead of space characters ( ) ??

  18. Ровшан Насибов Avatar

    СПАСИБО!!!!!! Thenks!!!!!!!!Very very very ver very^1000000

  19. volikoto Avatar

    Why does mine doesn't show anything if I run it?

  20. Jordan Olson Avatar

    bucky you're so gorgeous.

  21. Bearboyjd Avatar

    Ok so I want to let the user determine the name of the document being saved. if this is in the next few tutorials let me know and I will just keep going.

  22. Sniff Avatar

    Buckys C++ anal tutorial – 69 – Considering Suicide Because I'm A Faggot

  23. Jackson Brooks Avatar

    For some reason, I am unable to get my program to go through the while. I replaced the cout with a simple phrase and it displayed nothing so I know its the while portion. My code is as follows:

    // pliss hulp.cpp

    #include "stdafx.h"
    #include <iostream>
    #include <fstream>
    #include <string>
    using namespace std;

    int main()
    {
    ifstream theFile("vs.txt");

    int one;
    string name;
    double amount;

    while (theFile >> one >> name >> amount)
    {
    cout << one << ", " << name << ", " << amount << endl;
    }
    return 0;
    }

  24. Invalidstr ingError Avatar

    what the fuck is this >8( how the hell can you put a object a int a string and a double in a while loop; what is going on, are me just putting a object in the loop that dose magic and takes some args return true or false depicting if there is any thing left in the file to read.someone pls explain wizardly-nest

  25. Dan Varlan Avatar

    Cool tutorial, ty

  26. Nabila Aziz Avatar

    one word to describe you.
    AWESOME 🙂

  27. Morthea Avatar

    I think you might wanna add fstream on the title of this video. 🙂 great tutorial, thanks bucky

  28. Leembu0 Avatar

    <string> in the header ??

  29. yaboy grave Avatar

    how would you just read I'd 3's info?

  30. Chad McAdams Avatar

    Subbed for this! Lifesaver!!!

  31. Ismael M Avatar

    This was super helpful <3 Thank you. I am currently creating a graph for my data course. Was having trouble reading the locations and weights from provided text file. Thank you!

  32. Mahmoud Basyoni Avatar

    I have to say it, my friend you are the best. Thank you SO much

  33. Sooraj Singh Avatar

    andhera kayam rahe !!!

Leave a Reply

Your email address will not be published. Required fields are marked *