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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:08:17+00:00 2026-06-05T23:08:17+00:00

Why is this not compiling? error C2660: ‘Concrete::WriteLine’ : function does not take 1

  • 0

Why is this not compiling?
error C2660: ‘Concrete::WriteLine’ : function does not take 1 arguments
I know if i add the Line:
//using AbstractBase::WriteLine;
it works, but i dont understand why.

#include "iostream" 

class AbstractBase
{
public:
   virtual void WriteLine() = 0;
   virtual void WriteLine( int i )
   {
      std::cout<<"AbstractBase"<<std::endl;
   }
};

class Concrete : public AbstractBase
{
public:
   //using AbstractBase::WriteLine;
   virtual void WriteLine()
   {
      std::cout<<"Concrete Sub Class"<<std::endl;
   }
};

int main()
{
   Concrete ff;
   ff.WriteLine();
   ff.WriteLine(1);
   return 0;
}

Can someone explain me what happens here.
Thanx


Does anyone knows if this behavior is a defined behavior from the C++ standart.
Is it mentioned in the C++ standart?
Or is it just a kind of compiler behavior?

  • 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-05T23:08:19+00:00Added an answer on June 5, 2026 at 11:08 pm

    Once you declare a function:

    void WriteLine()
    

    in derived class it hides all the base class functions with the same name.
    The above function which takes no parameters hides the function with same name and taking one parameter, Since compiler cannot find a function with one parameter it reports a error.

    The line:

    using AbstractBase::WriteLine;
    

    enables(brings in scope) all the hidden names from the Base class in your derived class and hence the function taking one parameter is available.

    Good Read:
    What’s the meaning of, Warning: Derived::f(char) hides Base::f(double)?

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

Sidebar

Related Questions

char b; operator<<(cout,(operator>>(cin,b))); this is not compiling in vc++ because all 8 overloads cant
I'm not the best at compiling java but this was the best I could
Why does this not work? def straight(ranks): Return True if the ordered ranks form
This code is not compiling in my system; I'm using Eclipse. // Linked list
This code is not compiling. What modification can I do to achieve the desired
I had this constants in a Delphi 7 program. They are not compiling under
I keep getting random errors when compiling this function: (defun gcd (a b) (if
I had this code from a previous question, but its not compiling: public interface
Getting this error cross compiling node.js for optware (slug) on Ubuntu 11.10. /optware/cs05q1armel/builds/node/build/default/libv8.a(api.o): Relocations
Why is this C# code not compiling? public static Dictionary<short, MemoryBuffer> GetBulkCustom(int bufferId, int

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.