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 3944286
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:52:57+00:00 2026-05-20T00:52:57+00:00

I hav a base class which is abstract. I am inheritting a new class

  • 0

I hav a base class which is abstract. I am inheritting a new class from the abstract base which i could not instantiate an object. The reason the compiler tells is that

cannot allocate an object of abstract type

Is there any way to overcome this.

  • 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-05-20T00:52:57+00:00Added an answer on May 20, 2026 at 12:52 am

    cannot allocate an object of abstract type

    This indicates you’ve not implemented all the pure virtual functions in the derived class. So first, implement all the pure virtual functions, then create instance of this class.

    You cannot create instances of class which has even a single pure virtual function!

    Remember, pure virtual functions are those which are assigned with zero (C++ Virtual/Pure Virtual Explained), as

    class sample
    {
    public:
         virtual void f(); //virtual function
         virtual void g()=0; //pure virtual function
    };
    

    Here only g() is pure virtual function! This makes sample an abstract class, and if the derived class doesn’t define g(), it would also become an abstract class. You cannot create instance of any of these class, as both of them are abstract!

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

Sidebar

Related Questions

I have usercontrols which inherit a base class which looks like this: BasePage.cs: using
I hav been going over some old hw assignments from a class last semester.
If I have a table in MySQL which represents a base class, and I
I hav a php code where it displays buttons from A-Z: <table id=optionAndAnswer class=optionAndAnswer>
I hav used uigraphics cgcontext to draw line on touch...but my line is not
I hav asp.net mvc 3 application. When user pass id of non existing object
i am new to this iphone.... i hav navigation controller ,itoolbar having the button
i hav a piece of code in which i have been comparing 2D and
I hav a table with following fields public class ActivationCode { public virtual int
I hav especific need of removing word from string, But I am having problem

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.