CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Paul McKenzie

Search: Search took 4.16 seconds.

  1. Replies
    33
    Views
    7,878

    Re: Save/load functions not working

    I corrected the post to state POD types.

    Regards,

    Paul McKenzie
  2. Replies
    33
    Views
    7,878

    Re: Save/load functions not working

    Unlike other computer languages, when you make a mistake in C++, you are not guaranteed anything will work correctly, as D_Drmmr stated.
    C++ doesn't work that way. That code could run on 1,000...
  3. Replies
    33
    Views
    7,878

    Re: Save/load functions not working

    To prove my point, try this program:


    #include <iostream>
    #include <string>
    #include <fstream>

    class FileIO
    {
    public:
  4. Replies
    33
    Views
    7,878

    Re: Save/load functions not working

    It doesn't work fine.

    #include <iostream>

    using namespace std;

    class FileIO
    {
    public:
    int numInt;
  5. Replies
    33
    Views
    7,878

    Re: Save/load functions not working

    How is a general method going to know what your object consists of? You still have to write the code to output the contents to a file, and write the code to read the file. There are no shortcuts. ...
  6. Replies
    33
    Views
    7,878

    Re: Save/load functions not working

    Then you open up your code to an issue of buffer overrun if you now switch your struct to using char arrays.

    The issue is that you used a link that shows how to save 'C'-style or POD (Plain Old...
  7. Replies
    33
    Views
    7,878

    Re: Save/load functions not working

    If what you see in the file is gibberish, then you didn't save correctly. Reading gibberish will not turn it into any coherent.

    D_Drmmr gave the reason for the issue -- you must save data to a...
Results 1 to 7 of 7





Click Here to Expand Forum to Full Width

Featured