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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:29:23+00:00 2026-05-26T16:29:23+00:00

Why can you call C/C++ functions like this: (&myAwesomefunction)(arg1,arg2,arg3…); Surely taking the address of

  • 0

Why can you call C/C++ functions like this:

(&myAwesomefunction)(arg1,arg2,arg3...);

Surely taking the address of a function gives you a pointer/address. And as I understand it pointers are not callable as functions. What’s really happening?

Does it mean that I can call any address like a function?

// Is this legal?
int x = 69;
(&x)(3,78,69.456,'c','o','n','d','o','m');

What are the implications of THAT?

  • 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-26T16:29:24+00:00Added an answer on May 26, 2026 at 4:29 pm

    On the contrary, pointers to functions are the only things callable as functions. The definition of the function call operator starts out:

    The expression that denotes the called function shall have type
    pointer to function returning void or returning an object type other
    than an array type.

    (This means that your second hypothetical is not legal, because &x is does not have a type that is a pointer to a function of any sort).

    So, you might ask, why can you also call a function like this (where myAwesomefunction is an identifier declared as a function)?

    myAwesomefunction(arg1,arg2,arg3...);
    

    The answer is that a identifier like myAwesomefunction is a primary expression that evaluates to a function designator. The definition of a function designator says:

    A function designator is an expression that has function type. Except
    when it is the operand of the sizeof operator or the unary &
    operator, a function designator with type ‘‘function returning type’’
    is converted to an expression that has type ‘‘pointer to function
    returning type’’.

    So formally, when you write myAwesomefunction(arg1,arg2,arg3...);, myAwesomefunction evaluates to a function designator, which then is converted to a pointer to the function, which is then used to call the function.

    This conversion of a function designator to a pointer to the function is similar to the conversion of an expression with array type to a pointer to the array’s first element.

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

Sidebar

Related Questions

I would like to have a function that can wrap any other function call.
It's possible to call C functions through CREATE FUNCTION but how can .NET functions
How can I pass a functions name to a function and then call it?
I'm new to Perl and I understand you can call functions by name, like
in clojure i have vector [myfn1 myfn2 myfn3] how can i call functions named
When my interface rotates i want to call certain functions. How can I do
Using a delegate I can call any function asynchronously. From the documentation I understand
Let's say I need to use Python and C++. I can call Python function
Can I call a function from lisp from a library written in c or
Can you call a function that has no body but is declared in the

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.