Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7971251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:35:37+00:00 2026-06-04T07:35:37+00:00

Regarding when call copy constructor of base class, we have the form: DerivedClass (

  • 0

Regarding when call copy constructor of base class, we have the form:

DerivedClass ( const DerivedClass& obj ) : BaseClass ( obj ) 
{ 
// ... 
} 

I just do not understand why we pass object of derived class to the base class copy constructor.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:35:39+00:00Added an answer on June 4, 2026 at 7:35 am

    What else would you want to pass? Because the only other option is a magical pony conjured up from the air.

    It’s a typical “real type hidden behind a reference to parent” thing. Base class’ copy ctor has signature base(const base&). It doesn’t care if you pass a most derived type, or semi derived type, or maybe base type. It only sees the portion it cares about, which is base, and nothing else, so it can do its job properly.

    Of course that only works for types derived using public inheritance, which forms is-a relationship between the two.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question regarding the C++ Standard. Suppose you have a base class
I have a doubt regarding the backlog value in listen system call. From man
I have couple questions regarding some C++ rules. Why am I able to call
I have a problem with IE7 regarding an ajax call that is made by
I have to call a Web service that is extremely demanding (unstandard) regarding the
I have a question regarding a call to a function that takes quite a
So I have a FileReader class, it looks like this: #define DISALLOW_COPY(type) \ type(const
I have a question regarding how to call ruby classes that reside outside of
I have the following function: std::vector<double>residuals; std::cout << Print_res(std::cout); std::ostream& Print_res(std::ostream& os) const {
I need to call the co-class function by reading its address from vtable of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.