Can a class have multiple destructors?

This is a discussion on Can a class have multiple destructors? within the C++ Programming forums, part of the General Programming Boards category; Just curious, A class can have more than 1 constructors. Can a class have multiple destructors?...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    284

    Can a class have multiple destructors?

    Just curious, A class can have more than 1 constructors. Can a class have multiple destructors?

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,318
    No. A class can have more than one constructor if they have different parameters. A destructor doesn't have parameters, so there can be only one.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Defining derivated class problem
    By mikahell in forum C++ Programming
    Replies: 9
    Last Post: 08-22-2007, 02:46 PM
  2. Creating a database
    By Shamino in forum Game Programming
    Replies: 19
    Last Post: 06-10-2007, 01:09 PM
  3. deriving classes
    By l2u in forum C++ Programming
    Replies: 12
    Last Post: 01-15-2007, 04:01 PM
  4. Read-only class members
    By kidburla in forum C++ Programming
    Replies: 4
    Last Post: 10-14-2006, 12:52 PM
  5. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 06:18 AM

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