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

  • Home
  • SEARCH
  • 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 6238531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:13:57+00:00 2026-05-24T11:13:57+00:00

I am a beginner in C++. I wanted to know, how internally the function

  • 0

I am a beginner in C++. I wanted to know, how internally the function overloading takes place in C++

  • 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-24T11:13:58+00:00Added an answer on May 24, 2026 at 11:13 am

    I recommend you reading C++ Primer. This concept is explained in depth.

    On a higher level, function overloading is allowed if both the functions

    • have same name
    • declared in the same scope
    • have different parameter list.

    On the lower-level ( inside how compiler figures it out), here’s how it is done.

    There are 3 steps for function overloading resolution.

    e.g void f();   
        void f(int);
        void f(double, double = 3.4);
        void f(char *, char *);
    
        Function call inside main -> void f(5.6);
    
    1. Identifies the set of overloaded functions considered for the call, they are called as candidate functions. A candidate function is a function with the same name as the function that is called & for which declaration is visible at the point of call.
      It also identifies the properties of the argument list in the function call, i.e no of arguments and their types.

      Selected : All 4 functions with name ‘f’

    2. Selects the function from the set of candidate functions found in step 1 that can be called with arguments specified in the call. Those are called as viable functions.
      A viable function is a function that has the same nof of parameters or more parameters ( addn paramters has an associated default argument) than the arguments in the actual function call. Types of arguments must be convertible for the function to be classified as viable.

      Selected : void f(int) and void (double, double =3.4)

    3. Identifies the best viable function among the all viable functions.
      For (int) conversion need to apply which is a standard conversion (double to int). But for (double, double=3.4), there’s a exact match, so no conversion needed. No conversion is better than a conversion.

      Selected : void (double, double = 3.4 )

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

Sidebar

Related Questions

I'm playing around with beginner Haskell, and I wanted to write an average function.
I am a beginner with JasperReports and wanted to have example of how to
I know that extern C means the function should be compiled in C style
The function below takes the argv[0] argument that contains the calling path of the
I am a beginner when it comes to web programming, and I wanted to
I'm a beginner in C++ Programming language. I wanted to write a program that
I'm a beginner in powershell and know C# moderately well. Recently I was writing
as a beginner, I have formulated some ideas, but wanted to ask the community
Beginner level question Scenario: Have simple string cocantation tool, that I might expand later
Beginner help needed :) I am doign an example form a php book which

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.