Search:

Type: Posts; User: Loduwijk

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,591

    It appears the author is using just a normal...

    It appears the author is using just a normal class, nothing constant, and from the quote I mentioned it looks to me that his only reasoning was "It helps prevent errors."

    In fact, in an earlier...
  2. Replies
    5
    Views
    1,591

    Why use const in functions?

    I am reading something about C++, and it says "Methods that never change a class member value should be declared as constant using the const keyword in both the declaration and definition. This...
  3. Replies
    5
    Views
    1,187

    Ah yes, thank you. I wasn't thinking about the...

    Ah yes, thank you. I wasn't thinking about the unsigned integer part. That makes sense that it would cycle back around to the maximum value of the unsigned long int from the num2text function.

    I...
  4. Replies
    5
    Views
    1,187

    I didn't see how that could affect the output...

    I didn't see how that could affect the output there, unless it was num2text's fault, but I haven't had a problem with that function yet. Either way, here they are.


    //my point class
    class point...
  5. Replies
    5
    Views
    1,187

    Math problem: it thinks that 0-1=4 million

    I have the oddest problem now that I can't figure out. In my GetAngle function, I have a float that is the difference of two other floats and it is not calculating right. I have stripped everything...
  6. Replies
    2
    Views
    5,247

    That math.h it mentioned did the trick. Thanks...

    That math.h it mentioned did the trick. Thanks again.

    I feel my headache going away already.

    (edit)
    It's been a while, but didn't there used to be a way to mark my thread as resolved? The...
  7. Replies
    2
    Views
    5,247

    arccos problem

    I've been digging on this site and through google, but I can't find an arccos function anywhere; all I find are discussions about it and about dot products which I don't understand, it's all theory...
  8. Replies
    7
    Views
    7,612

    I can't get this new compiler to work.

    Since I couldn't get Dev-C++ to work again (I went so far as to uninstall, delete every remnant of dev-c++ related stuff left over that I could see, reboot, defrag, reboot, redownload the setup again...
  9. How do I represent an integer in hexidecimal form in the code?

    How do I use the hexidecimal system in my code? Something like...


    int my_int = F61B;

    And other numbering systems for that matter, though hexidecimal is the only one I actually need for the...
  10. Replies
    5
    Views
    3,358

    Alright, I just tried that and it's still screwed...

    Alright, I just tried that and it's still screwed up.

    Is it possible that the compiler after corruption could have corrupted the project files? Should I try recreating the projects from scratch,...
  11. Replies
    5
    Views
    3,358

    Yes, and at first it was compiling just fine when...

    Yes, and at first it was compiling just fine when I try it on my other project. However, I just updated my original post at the same time you replied; apparently, it is crashing on the other project...
  12. Replies
    5
    Views
    3,358

    Compile crashes certain windows

    (update)
    Ack! I thought it was that program because the compiler was working fine yesterday, and just today when I start this new one it starts crashing. However, the compiler is crashing now even...
  13. *sigh* That's what I was afraid of. Thanks.

    *sigh* That's what I was afraid of. Thanks.
  14. How do I get the overloaded constructor to be recognised by derived class?

    If you overload a class' constructor and then use that new constructor, are derived classes then forced to define the new constructor as well?

    With the default constructor, I could just do...
  15. Replies
    5
    Views
    2,111

    (edit) I just made the contents vector a vector...

    (edit)
    I just made the contents vector a vector of atom pointers rather than atom references, and that at least ends up outputting contents[0]->name. It appears to at least be adding the things.
    ...
  16. Replies
    13
    Views
    26,533

    Which code, the last one that I said works? It...

    Which code, the last one that I said works? It was just an example, not the actual code that I have. Still, I'm using Bloodshed's Dev-C++.

    Even so, what was wrong with it that would make it not...
  17. Replies
    5
    Views
    2,111

    vector contents mysteriously vanishing

    For a class I have, it uses a vector to keep track of objects that are "in" it. I've recently restructured my code, and it is now broken. It does not keep track of objects correctly.

    Everything...
  18. Took some time to find something that explained...

    Took some time to find something that explained it well enough, but I did. I doubt I'll be able to remember that though, so I bookmarked it the explanation I found.

    Thanks much.
  19. Is there a way to tell what class an object is?

    Is there a way to tell what type of class an object is?

    I want to tag objects of a few types with an id integer, and I want the classes to have seperate id index counters. The problem I'm running...
  20. Replies
    13
    Views
    26,533

    Same example as before. object1 { ...

    Same example as before.


    object1
    {
    public:
    object1(void)
    {cout << "This is object1, the base class. I do not want this to be be output when you are creating an object2.\n";}
    };
    object2
  21. Replies
    13
    Views
    26,533

    Thank you for confirming that for me, 7stud. ...

    Thank you for confirming that for me, 7stud.

    So then, if I want to have different things happen when base and derived classes are made, and the things for the derived class should not include...
  22. Replies
    13
    Views
    26,533

    That's my whole point; it doesn't work. Well,...

    That's my whole point; it doesn't work.

    Well, to be honest, I didn't try the entirety of the book's code example. The example I gave was not a direct quote from the book. The book's example is...
  23. Replies
    13
    Views
    26,533

    The "void special_item(void){}" line is to...

    The "void special_item(void){}" line is to override the parent type's constructor. I don't understand why it works this way, but I'm just following what it says in my book. Though further tests show...
  24. Replies
    13
    Views
    26,533

    And what does that mean? What is a method...

    And what does that mean? What is a method signature? Do you refer to the parameter thing I mentioned?

    Indeed I do, concerning item_id. It's a global variable that starts at 0, that's all.

    So I...
  25. Replies
    13
    Views
    26,533

    How do I override constructor in inheritance?

    I'm trying to use inheritance now to make things much more organised. I have a superclass of type item and an inheriting class of type special_item.

    The book I'm reading an example from has...
Results 1 to 25 of 41
Page 1 of 2 1 2