Sequence of Destructor

This is a discussion on Sequence of Destructor within the C++ Programming forums, part of the General Programming Boards category; I don't understand why the sequence of the Destructor of these two classes are different? Does that make any difference? ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    22

    Question Sequence of Destructor

    I don't understand why the sequence of the Destructor of these two classes are different? Does that make any difference?

    Code:
    class Date
    {
    public:
    	Date( int = 1, int = 1, int = 1990 );
    	~Date();
    	void print();
    
    private:
    	......
    };
    
    class Date
    {
    public:
    	Date( int = 1, int = 1, int = 1990 );
    	void print();
    	~Date();
    
    private:
    	...
    };

  2. #2
    Unregistered
    Guest

    sequence

    It does not make a difference since these are only the declarations. They should however be grouped for better readiblity. Usually the constructor and the desctructor should be right next to each other.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 06-10-2008, 08:38 PM
  2. Immediate programming help! Please!
    By xMEGANx in forum C++ Programming
    Replies: 6
    Last Post: 02-20-2008, 11:52 AM
  3. sequence
    By braddy in forum C Programming
    Replies: 2
    Last Post: 03-30-2006, 01:15 PM
  4. wsprintf and format specifiers
    By incognito in forum Windows Programming
    Replies: 2
    Last Post: 01-03-2004, 09:00 PM
  5. How do I restart a random number sequence.
    By jeffski in forum C Programming
    Replies: 6
    Last Post: 05-29-2003, 02:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21