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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:15:17+00:00 2026-06-17T09:15:17+00:00

I’m probably being a complete idiot, but I’ve just seen this C++ syntax and

  • 0

I’m probably being a complete idiot, but I’ve just seen this C++ syntax and I can’t for the life of me work out what it’s doing:

(*x)(&a, b, c);

A quick answer would be greatly appreciated.

  • 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-17T09:15:18+00:00Added an answer on June 17, 2026 at 9:15 am

    Well there can be many more possibilities: it all depends on the type of all entities: x, a, b, c. In C++, you can overload even comma operator.

    But I will only focus on x, and see how things turn out to be. The actual answer, however, will be too long if all combinations are taken into account.

    (*x)(&a, b, c);
    

    Here x could one of these:

    • A function pointer
    • A pointer to function object.
    • An iterator which on dereferencing returns function pointer or function object.
    • (one more at the bottom which is partially covered by the previous one!)

    And then you’re invoking it passing three arguments to it.

    Here are few examples, assuming all other entities (a, b c) as int:

    • An assumption

       int a,b,c; //FIXED as per the assumption
      
    • Function pointer

       void f(int *,int, int);
       auto *x = f;
       (*x)(&a,b,c); //x is function pointer 
       x(&a,b,c);    //works fine, even without (*x)
      
    • Function object

      struct X { void operator()(int*,int,int); };
      
      X y, *x = &y;
      (*x)(&a,b,c);  //x is pointer to function object
      
    • Iterator

      std::list<std::function<void(int*,int,int)> l {X(), f};
      auto x = l.begin();  //x is an iterator
      (*x)(&a,b,c);  //(*x) is function object
      ++x;
      (*x)(&a,b,c);  //(*x) is function object (still!)
      
      //OR
      std::list<void(int*,int,int)> l {f};
      auto x = l.begin();  //x is an iterator
      (*x)(&a,b,c);  //(*x) is function pointer!
      

    As @David said in comment that:

    However, there is a fourth possibility: x could be an instance of some class that overloads operator* to return a function pointer or function object.

    which is true, but I believe this possibility is partially covered by iterator, or at least the iterator example gave you enough hint to figure it out yourself. 🙂

    Hope that helps.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't

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.