Thread: Inherite nonvirtual class functionality

  1. #1
    Registered User
    Join Date
    Oct 2007

    Inherite nonvirtual class functionality

    Hi, let's see if you can follow this... I have made a virtual class that inherits from another virtual class. The old virtual class had a implementation class that inherited from it that now instead inherits from my new virtual class. The new implementation class made for the new virtual class needs to use some functions from the "old" implementation class that are only defined inside that class and not in the old virtual class.

    How do I set things up so that my new implementation class can use functions from the other implementation class that are not defined in the original virtual class?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    I do not quite follow you. Mind giving a code example? It is also not clear if the "old" classes are removed, or if they continue to exist.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Oct 2007
    Nevermind, it turns out that I don't need a second implementation class. I can implement the new functionality in the exsting one which means I have access to all its functions. Just kept the new virtual class and adjusted inheritance.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Specializing class
    By Elysia in forum C++ Programming
    Replies: 6
    Last Post: 09-28-2008, 04:30 AM
  2. matrix class
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 07-13-2007, 01:03 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Replies: 7
    Last Post: 05-26-2005, 10:48 AM
  5. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 01:30 PM