Thread: inheritance from classes own members?

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    4

    inheritance from classes own members?

    Reading about Inheritance I don't quite understand the following

    Code:
    Mammal::Mammal(): itsAge(1), itsWeight(5)
    {
    cout << "Mammal constructor...\n";
    }
    My question is, what is realy going on here? itsAge and itsWeight are both member variables of the Mammal class. Is this Inheritance and why would a class try to inherit from itself?

    Can someone please explain?

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    4

    Thank you

    Thanks that fully explains it, and thanks to Cat for the origional answer.

    I had searched prior to posting but could only find inheritance from base classes and nothing such as this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. templated members in non-template classes
    By drrngrvy in forum C++ Programming
    Replies: 3
    Last Post: 04-07-2007, 01:38 PM
  2. Multiple Inheritance - Size of Classes?
    By Zeusbwr in forum C++ Programming
    Replies: 10
    Last Post: 11-26-2004, 09:04 AM
  3. Class with members as classes
    By justdoit22 in forum C++ Programming
    Replies: 8
    Last Post: 12-29-2003, 06:58 PM
  4. Inheritance Classes w/ same function name
    By Diamonds in forum C++ Programming
    Replies: 3
    Last Post: 03-11-2003, 01:11 AM
  5. Help with classes & strings members
    By GrNxxDaY in forum C++ Programming
    Replies: 7
    Last Post: 07-21-2002, 08:29 PM