Class Constructor

This is a discussion on Class Constructor within the C++ Programming forums, part of the General Programming Boards category; If I do this Code: class Class1 : public Class2, public Class3 { // blah } Shouldnt Class2 and Class3's ...

  1. #1
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200

    Class Constructor

    If I do this

    Code:
    class Class1 : public Class2, public Class3
    {
    
         // blah
    
    }
    Shouldnt Class2 and Class3's constructors be called?

    I am having some seg faults and the program obviously has memory leaks because my PC usage is 99%.

    I cant find whats happening though.
    What is C++?

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    Yes, Class2 and Class3 will have their constructors called.

    If you CPU usage is at 99%, you are probably stuck in a loop somewhere. I would check that first. I cant really give any more advice without seeing your code.

  3. #3
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Well, its alot of code.

    Ive used a debugger on it several time and something is definately wrong. But, i'll find it tomorrow, im sleepy.
    What is C++?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. deriving classes
    By l2u in forum C++ Programming
    Replies: 12
    Last Post: 01-15-2007, 04:01 PM
  3. template class default constructor problem
    By kocika73 in forum C++ Programming
    Replies: 3
    Last Post: 04-22-2006, 09:42 PM
  4. Calling constructor of the base class of a derived class..
    By CaptainPenguin in forum C++ Programming
    Replies: 5
    Last Post: 02-19-2003, 12:47 PM
  5. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM

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