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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:52:23+00:00 2026-05-23T13:52:23+00:00

Yes, I’ve seen this question and this FAQ , but I still don’t understand

  • 0

Yes, I’ve seen this question and this FAQ, but I still don’t understand what ->* and .* mean in C++.
Those pages provide information about the operators (such as overloading), but don’t seem to explain well what they are.

What are ->* and .* in C++, and when do you need to use them as compared to -> and .?

  • 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-23T13:52:24+00:00Added an answer on May 23, 2026 at 1:52 pm

    I hope this example will clear things for you

    //we have a class
    struct X
    {
       void f() {}
       void g() {}
    };
    
    typedef void (X::*pointer)();
    //ok, let's take a pointer and assign f to it.
    pointer somePointer = &X::f;
    //now I want to call somePointer. But for that, I need an object
    X x;
    //now I call the member function on x like this
    (x.*somePointer)(); //will call x.f()
    //now, suppose x is not an object but a pointer to object
    X* px = new X;
    //I want to call the memfun pointer on px. I use ->*
    (px ->* somePointer)(); //will call px->f();
    

    Now, you can’t use x.somePointer(), or px->somePointer() because there is no such member in class X. For that the special member function pointer call syntax is used… just try a few examples yourself ,you’ll get used to it

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

Sidebar

Related Questions

Yes I have seen This question But it's for php. I'm still new to
Yes, I'm aware that this question has already been post, but ... I'm looking
Yes, this sounds like a simple question, and it probably is. But when i
YES, i read other posts but i still can´t figure this out... I have
Yes, I am still on Drupal 5. Don't make fun. I created a category
Yes, it's a trivial piece of code to write, but I still wonder if
Yes, yes, I've weighed using an xml parser instead of regular expressions, but this
Yes, I have googled this question and even referred to my textbook (PHP by
...Yes I've seen: Best Resources for Learning JavaFX? but it doesn't really answer the
Yes, this question has been asked many times, and I've been looking and reading

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.