Thread: derived class

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    109
    Quote Originally Posted by brewbuck View Post
    The base constructor is always called. If you do not do it yourself, the argument-less constructor (default or user-supplied) is invoked. If no such constructor exists, you get a compile time error.

    It's impossible to fail to initialize the base class. It just might not happen quite the way you wanted, is all.
    Do you know how I can fix my class? Thanks

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by BKurosawa View Post
    Do you know how I can fix my class? Thanks
    I have no idea what's wrong with it. You haven't told us.

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    109
    Quote Originally Posted by brewbuck View Post
    I have no idea what's wrong with it. You haven't told us.
    I mean is there anything wrong with the code? Because the program crashes when I run it. When I debug it breaks it opens up a new set of code in the ostream library and it points to this:

    Code:
    		__CLR_OR_THIS_CALL ~_Sentry_base()
    			{	// destroy after unlocking
    			if (_Myostr.rdbuf() != 0)
    				_Myostr.rdbuf()->_Unlock();
    			}
    I have no idea why it does that. Any ideas? Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. call base class function or derived class function
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 03-18-2008, 05:23 AM
  2. Two conceptual questions
    By AntiScience in forum C++ Programming
    Replies: 3
    Last Post: 11-01-2007, 11:36 AM
  3. derived class can not access base class protected member?
    By George2 in forum C++ Programming
    Replies: 2
    Last Post: 10-21-2007, 06:32 PM
  4. Replies: 4
    Last Post: 12-29-2002, 12:29 AM
  5. Constructors + Derived class
    By MethodMan in forum C++ Programming
    Replies: 6
    Last Post: 11-10-2002, 05:05 PM