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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:45:16+00:00 2026-05-22T20:45:16+00:00

The name of a function is a pointer to the function… But in case

  • 0

The name of a function is a pointer to the function…
But in case of function overloading the names of two functions are the same…
So which function does the name point to?

  • 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-22T20:45:16+00:00Added an answer on May 22, 2026 at 8:45 pm

    It depends on the context; otherwise it’s ambiguous. See this example (modified except below):

    void foo(int a) { }
    void foo(int a, char b) { }
    
    int main()
    {
        void (*functionPointer1)(int);
        void (*functionPointer2)(int, char);
        functionPointer1 = foo; // gets address of foo(int)
        functionPointer2 = foo; // gets address of foo(int, char)
    }
    

    You can do this in many ways, but the #1 rule?

    Avoid casts!

    Otherwise you’ll break type safety and probably shoot yourself in the foot either then or later.
    (Issues can come up with calling conventions, random changes you don’t notice, etc.)

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

Sidebar

Related Questions

How to get function's name from function's pointer in C? Edit: The real case
Does anyone happen to remember the function name used to generate sequential row number
Why and how does dereferencing a function pointer just do nothing? This is what
I need to make a function which adds a function pointer to map. It
Is there anything in Clojure that is equivalent to Common Lisp's symbol-name function?
Exact duplicate of Function name for creating something if it's not there yet I
var Dog = function(name) { this.name = name; this.sayName(); } Dog.prototype.sayName = function() {
I want to output the function name each time it is called, I can
I have been using PRETTY_FUNCTION to output the current function name, however I have
im trying to make a small name summary function depending on the size 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.