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

Search:

Type: Posts; User: KruSuPhy

Search: Search took 0.02 seconds.

  1. Replies
    33
    Views
    7,751

    Re: Save/load functions not working

    I'm not quite sure how to implement the SQLite into my program, but i'm going to look it up and try.
    Also, as for the name with spaces problem I'm having, I attempted to use getline() for the input,...
  2. Replies
    33
    Views
    7,751

    Re: Save/load functions not working

    Well, I ran into that problem earlier. If the name contains a space, it only counts everything before the space. Which I assume you already knew. However, I'm not quite sure how to fix that. I'm sure...
  3. Replies
    33
    Views
    7,751

    Re: Save/load functions not working

    Okay, well, I finally understood what you all were telling me and went ahead and fixed it. It works/'seems' to work, so here's my code.

    void Game::saveGame(Character player)
    {
    std::ofstream...
  4. Replies
    33
    Views
    7,751

    Re: Save/load functions not working

    Okay, I apologize, and I'm not doubting what you're saying at all. However, could you explain how my example is wrong? I tested it and it worked well enough. I'm not sure if I understand what's wrong...
  5. Replies
    33
    Views
    7,751

    Re: Save/load functions not working

    #include <iostream>

    using namespace std;

    class FileIO
    {
    public:
    int numInt;
    double numDouble;
    string name;
  6. Replies
    33
    Views
    7,751

    Re: Save/load functions not working

    Post if you want, but at least try to provide some useful information as opposed to getting upset over something I've already apologized for.
    Also, I'm sorry that I'm not exactly knowledgable in C++...
  7. Replies
    33
    Views
    7,751

    Re: Save/load functions not working

    Okay, I apologized for it. Don't get an attitude in my thread, you haven't even contributed in the slightest amount, thanks. If you don't have anything worthwhile to say, then don't post.
  8. Replies
    33
    Views
    7,751

    Re: Save/load functions not working

    Sorry, the example was pseudo-code someone suggested in another topic on another website. I'm afraid I don't have or know the complete code for that method, I was just wondering if there is a method...
  9. Replies
    33
    Views
    7,751

    Re: Save/load functions not working

    So, should I use something like this, then?

    SaveGame(FileInput file) {
    file.writeInt(playerLevel);
    file.writeInt(playerHealth);
    file.writeInt(gameProgress);
    }
    ...
  10. Replies
    33
    Views
    7,751

    Re: Save/load functions not working

    I am currently not at home, and cannot post the code from my program, but I am using pretty much a replica of the code that PredicateNormative posted in my previous thread...
  11. Replies
    33
    Views
    7,751

    Save/load functions not working

    Hi. I've been working on a battle simulator, and using it as a learning experience. So far, I've been able to debug the program(with some help), and learn some stuff, and it's been running smoothly....
  12. Re: Will you tell me how badly I wrote small battle-game?

    I'm not sure if you were saying that just as a tip, or if you meant it was the fix to my problem, but I removed the extra srand()s and the player and NPC are now hitting for different amounts each...
  13. Re: Will you tell me how badly I wrote small battle-game?

    Thanks for the tips. I've gotten rid of the battle class, and just changed it to a function. I have a question for a 'bug' that I'm not quite sure how to fix.
    During battles, the player and npc will...
  14. Re: Will you tell me how badly I wrote small battle-game?

    I meant that you would be passing name() by reference as opposed to by value.

    Anyway, I tried to take the advice and went and attempted to re-make the game from a more Object-Oriented mindset,...
  15. Re: Will you tell me how badly I wrote small battle-game?

    Thanks for the link, I'm looking into it right now. From that page, I've gotten into looking at what Pass by reference is.
    So what I'm understanding now is that const std::string& must be the same...
  16. Re: Will you tell me how badly I wrote small battle-game?

    const std::string& name() const { return m_name; }
    Can someone help me with this tidbit? I understand that you call the return type, which is std::string, name it(name), and the {...
  17. Re: Will you tell me how badly I wrote small battle-game?

    Thanks for your criticism, but I have some answers to your questions:

    1. I tried initializing my variables with a value, but I believe when I tried doing that, I kept encountering the "crosses...
  18. Will you tell me how badly I wrote small battle-game?

    Hi, I recently picked back up on C++(and by recently, I mean this morning) after not looking at it for a while. I've never known very much C++, but I've tried to learn before and gave up. However,...
Results 1 to 18 of 18





Click Here to Expand Forum to Full Width

Featured