Search:

Type: Posts; User: Elysia

Search: Search took 0.10 seconds.

  1. Replies
    18
    Views
    3,907

    Best read up about inheritance, polymorphism and...

    Best read up about inheritance, polymorphism and virtual functions, as well as abstract base classes (pure virtual functions).
    Not using virtual correct can mean overhead and headaches.

    Also,...
  2. Replies
    18
    Views
    3,907

    I believe the rule is that if you have a virtual...

    I believe the rule is that if you have a virtual function, the destructor should be virtual since it implies you are going to use polymorphism. Inheritance does not necessarily mean you are going to...
  3. Replies
    18
    Views
    3,907

    But as said, pointers do not actually create...

    But as said, pointers do not actually create objects. They will point to them, and it's your job to thus create objects and make sure those pointers actually point to those objects later.
    There's...
  4. Replies
    18
    Views
    3,907

    Use pointers to point to the same object. Like...

    Use pointers to point to the same object. Like when you need to keep references to objects.
    When you do not need pointers, do not use them.
  5. Replies
    18
    Views
    3,907

    http://apps.sourceforge.net/mediawiki/cpwiki/index...

    http://apps.sourceforge.net/mediawiki/cpwiki/index.php?title=Common_mistakes_and_errors#Using_pointers_without_allocating_them
  6. Replies
    18
    Views
    3,907

    Does P1 point to a valid instance?

    Does P1 point to a valid instance?
  7. Replies
    18
    Views
    3,907

    I assume you are doing this? player* p1;...

    I assume you are doing this?

    player* p1;
    p1->whatever();
    If yes, then Meldreth has already told you the answer.
    A pointer is a variable that contains a memory address. It does not create...
Results 1 to 7 of 7