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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:51:05+00:00 2026-06-09T16:51:05+00:00

Possible Duplicate: function call with different semantics I am reading about function pointers in

  • 0

Possible Duplicate:
function call with different semantics

I am reading about function pointers in C. I tried this program:

#include <stdio.h>

int foo(void)
{
    printf("At foo.");
    return 0;
}

int main (void)
{
    printf("%p\t%p\t%p\n", &foo, foo, *foo);
    return 0;
}

The output for this program is:

0040138C    0040138C    0040138C

In 1-D array <datatype> <identifier>[N], identifier and &identifier points to the same value but the nature of the values are different. One is of type datatype* and the other is of type pointer to the 1-D array. Analogously, for functions, the foo and &foo are the same. But what about *foo and what is the nature of &foo, foo, *foo?

  • 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-09T16:51:07+00:00Added an answer on June 9, 2026 at 4:51 pm

    A plain foo is already a function pointer:

    6.3.2.1 – 4

    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
    ’’.

    You may obtain the address of a function using &, which yields a pointer to function ...:

    6.5.3.1 – 1-3

    The operand of the unary & operator shall be either a function
    designator… The unary & operator yields the address of its operand.
    If the operand has type ‘‘type’’,
    the result has type ‘‘pointer to type’’

    It’s legal to apply the indirection operator to a function designator:

    6.5.3.2 – 3

    The unary * operator denotes indirection. If the operand points to a
    function, the result is a function designator

    tldr:

    So there you have it. They all do the same thing.


    EDIT

    What is ‘function type` in C

    Quick! To the standard!

    6.2.5 – 1

    Types are partitioned into object types (types that describe
    objects) and function types (types that describe functions).

    6.2.5 – 20

    A function type describes a function with specified return type. A
    function type is characterized by its return type and the
    number and types of its parameters. A function type is said to be
    derived from its return type, and if its return type is T, the
    function type is sometimes called ‘‘function returning T’’. The
    construction of a function type from a return type is called
    ‘‘function type derivation’’

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

Sidebar

Related Questions

Possible Duplicate: «F(5)» and «int x; F(x)» to call different functions? Can we overload
Possible Duplicate: Can main function call itself in C++? I found this problem very
Possible Duplicate: lambdas require capturing 'this' to call static member function? I want to
Possible Duplicate: How to call javascript function from c# Is there a way to
Possible Duplicate: CakePHP: Call to a member function find() on a non-object I have
Possible Duplicate: calling ASP function from javascript okay running this code : <script type=text/javascript>
Possible Duplicate: Understanding NSString comparison in Objective-C Was just reading up about equality vs
Possible Duplicate: Call php function from javascript I understand that php is server side
Possible Duplicate: how can I call javascript function from another project in same solution?
Possible Duplicate: A call to PInvoke function '[…]' has unbalanced the stack I'm trying

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.