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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:25:14+00:00 2026-06-16T09:25:14+00:00

Possible Duplicate: How to call a function using pointer-to-member-function Analyzer.h class Analyzer { public

  • 0

Possible Duplicate:
How to call a function using pointer-to-member-function

Analyzer.h

class Analyzer
{
public :

    void viku();
    void Bibek();
    void vivek();
    void (Analyzer::*point)();

    Analyzer(){

    }
    ~Analyzer(){

    }

};

Analyzer.cpp

    using namespace std     
    #include"Analyzer.h"
    void Analyzer::viku(){
        cout<<"Hello viku";
    }
    void Analyzer::vivek(){
        point =&Analyzer::viku; 
        Bibek();   
    }
    void Analyzer::Bibek(){
           point();//Errror
        cout<<"Bibek";
    }

During compilation it shows the following error:

error C2064: term does not evaluate to a function taking 0 arguments.

Can anyone please tell me how to avoid this?

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

    Pointers to member functions are different than normal function pointer. You need an instance to call them:

    #include <iostream>
    
    class A
    {
    public:
      int foo()
      {
          std::cout << "A::foo here, you can have 42" << std::endl;
          return 42;
      }
    };
    
    int main ()
    {
      int (A::* point)() = &A::foo;
      A a;
    
      (a.*point)();
    }
    

    In your case, you’d need to do something like the following:

    (this->*point)()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: CakePHP: Call to a member function find() on a non-object I have
Possible Duplicate: lambdas require capturing 'this' to call static member function? I want to
Possible Duplicate: How to solve “call to undefined function domxml_new_doc()…” I'm using php5, when
Possible Duplicate: Can I call functions that take an array/pointer argument using a std::vector
Possible Duplicate: How to timeout a thread I am using a function call to
Possible Duplicate: How does dereferencing of a function pointer happen? If we have void
Possible Duplicate: C++ Static member method call on class instance Today I discovered that
Possible Duplicate: using jquery $.ajax to call a PHP function I need to call
Possible Duplicate: Why am I able to make a function call using an invalid
Possible Duplicate: Call to a member function on a non-object What is wrong with

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.