Problem with constructors

From: darkstorm (manuthomas23_at_hotmail.com)
Date: 03/30/05

  • Next message: Peter MacMillan: "Re: Problem with constructors"
    Date: 29 Mar 2005 23:13:57 -0800
    
    

    I have a problem with constructors.

    Consider this:

    class A
    {
    public:
       void Fun();
    private:
       Vector2D vec;--------(A)
    };

    void A::Fun()
    {
       Vector2D vec1;-------(B)
       .
       .
       .
    }

    Here at (B) constructor for Vector2D is getting called, but at (A)
    constructor is not getting called. What can be the reason?

    Thanks


  • Next message: Peter MacMillan: "Re: Problem with constructors"

    Relevant Pages

    • Re: Benefits of Protected Construtors in MFC
      ... I want to ask you about logic behind the protected constructors in MFC. ... virtual void Dumpconst; ... CMultiDocTemplate * GreenTemplate; ... cannot be used already in either a string, icon, or menu context. ...
      (microsoft.public.vc.mfc)
    • Re: Benefits of Protected Construtors in MFC
      ... I use public constructors when I have embedded FormViews derived from a class which lives in a static library. ... > virtual void Dumpconst; ... CMultiDocTemplate * GreenTemplate; ... cannot be used already in either a string, icon, or menu context. ...
      (microsoft.public.vc.mfc)
    • Re: [PHP] How can I do this -- method chaining
      ... I believe constructors return void, ... the 'new' keyword returns a copy of the object. ... public static function getInstance() { ...
      (php.general)
    • Re: template copy constructor
      ... auto_ptr without template functions, and it works. ... That's because you don't have any constructors from "wrong" odd_ptr ... X& operator*const throw; ... void resetthrow; ...
      (microsoft.public.vc.language)
    • Re: Best way to develop in parallel
      ... Both have exactly the same method signatures, constructors, etc. ... How can I easily switch between the classes? ... Have the test code refer to the interface and construct one or the other based on some condition. ... void testB() ...
      (comp.lang.java.help)