Search:

Type: Posts; User: G4B3

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    17
    Views
    2,163

    Those two functions are used to update the...

    Those two functions are used to update the positions due to the effects of gravity, and "wrap" the star's position if it goes off screen. I was wondering though, when dereferencing the iterator, it...
  2. Replies
    17
    Views
    2,163

    I was passing references in the original code,...

    I was passing references in the original code, but I just haven't gotten around to rewriting it to use lists/iterators. The prototypes for the two highlighted functions are:


    void...
  3. Replies
    17
    Views
    2,163

    Oh...I though the constructor was called for...

    Oh...I though the constructor was called for every object. So something like this?


    ClUniverse::ClUniverse()
    {
    for(int x = 0; x < ClValues::nNumObjects; x++) {
    ClStar TheStar;
    ...
  4. Replies
    17
    Views
    2,163

    *blush* that is an embarrassingly obvious...

    *blush* that is an embarrassingly obvious solution isn't it...

    Anyway, did that, and it did help a little bit. Turns out the constructor only gets called once, or so it seems. s_nNumStars is...
  5. Replies
    17
    Views
    2,163

    I call srand() in an initiation class that I...

    I call srand() in an initiation class that I haven't posted, but it get's called. It did before, and I haven't touched that code since I wrote it. As for adding anything to the list, shouldn't that...
  6. Replies
    17
    Views
    2,163

    Constructor problem in list of classes

    Hey all,

    I have a list of classes enclosed in a class:



    /* The controling class of the whole program. Calls the functions responsible for displacement calculation and object rendering,
    *...
  7. Replies
    3
    Views
    1,152

    advance() was the function I was looking for....

    advance() was the function I was looking for. Thanks, I completely missed it in the reference.

    Cheers,

    Gabe

    PS.: Sorry about the + sizeof(TheClass) thing, I mixed things up in my head and...
  8. Replies
    3
    Views
    1,152

    Moving an iterator forward

    Hey all,

    I have a list of classes, and two iterators, it_cur and it_nxt. It_cur points to some element, and I need it_nxt to point to the element after it_cur. Is there any simple built in way to...
  9. Replies
    2
    Views
    2,090

    First of all, it's cin >> FileName. Second,...

    First of all, it's cin >> FileName. Second, you're missing a parenthesis on the next line. Third, in the inChar function, what are the arguments supposed to be? If the first one was supposed to be a...
  10. Replies
    25
    Views
    2,271

    Okay, one more question. I have a class that's...

    Okay, one more question. I have a class that's made up entirely of static variables used throughout the program, such as screen size, number of objects, and general stuff like that. I'm next to...
  11. Replies
    25
    Views
    2,271

    Well...that changes things. Okay, I'll have a...

    Well...that changes things. Okay, I'll have a look as soon as I get back.




    That would fit, since I was learning Java for a while a couple of months back. In that case, where should I declare...
  12. Replies
    25
    Views
    2,271

    As I said, that part is preference; I just prefer...

    As I said, that part is preference; I just prefer not to have functions declared basically in the middle of nowhere. I always prefer to have an object containing the function I need, even if that...
  13. Replies
    25
    Views
    2,271

    Hey, all right already :-D I get the message....

    Hey, all right already :-D I get the message. I'll be a good boy from now on. Is converting it to a function object the right thing to do?
  14. Replies
    25
    Views
    2,271

    Well it seem very OOP to me. You need something...

    Well it seem very OOP to me. You need something done, and to get that something done, you have to build something else. So you build the something else, run the original something through it, and...
  15. Replies
    25
    Views
    2,271

    Preference, I guess. Is there any disadvantage? ...

    Preference, I guess. Is there any disadvantage?

    And that fact that the compiler considers it a redeclaration (it's already declared a few lines above) baffles me as much as the consequences. Any...
  16. Replies
    25
    Views
    2,271

    May God strike down pointers

    Hey all,

    I have a problem with pointers, one which I am completely unable to comprehend. But first, here's part of the code:


    /* The controling class of the whole program. Calls the functions...
  17. Replies
    7
    Views
    1,012

    Wow, never heard of that before. Thanks...

    Wow, never heard of that before. Thanks laserlight ;-)
  18. Replies
    7
    Views
    1,012

    Thanks for the responses. I know you're not...

    Thanks for the responses. I know you're not supposed to do that even when mommy's not watching, as I said I was just playing around.

    Anon: I'm not sure I understand what's going on there...I've...
  19. Replies
    7
    Views
    1,012

    >> Destructor Question

    Hey all,


    class Test {
    int m_Val;

    public:

    void printVal() { cout << m_Val << endl; }
  20. I guess this goes hand in hand with a problem I...

    I guess this goes hand in hand with a problem I had when I first compiled the program, when for some reason ClassMath.h had "compile file" and "link file" checked in its properties. Anyway, I fixed...
  21. Oh...well, again because of personal preference,...

    Oh...well, again because of personal preference, I decided to include all the files in the headers, since the .cpp files include the headers plus everything the headers include. Didn't know it could...
  22. ClassMath is only dependent on , ...

    ClassMath is only dependent on <cmath>, <cstdlib> and "ClassRange.h". It needs the former two and while it doesn't need the last, I still don't see how that could be preventing a successful...
  23. Well, when I include the definition in the class,...

    Well, when I include the definition in the class, as in


    #ifndef CLASS_MATH_H
    #define CLASS_MATH_H

    #include <cmath>
    #include <cstdlib>
    #include "ClassRange.h"
  24. Sure, although I doubt that will help you much;...

    Sure, although I doubt that will help you much; main is a mess, I haven't cleaned it up yet, and ClassRange has been used in a couple of programs before without any problems


    //ClassRange.h
    ...
  25. Yup. The program works fine, I'm just tweaking it...

    Yup. The program works fine, I'm just tweaking it a bit so it'll look better, and once I add that function it won't compile.
Results 1 to 25 of 71
Page 1 of 3 1 2 3