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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:27:21+00:00 2026-06-11T14:27:21+00:00

I am getting a C2064 error below below in trying to invoke a function.

  • 0

I am getting a C2064 error below below in trying to invoke a function. What am I doing wrong?

//error C2064: term does not evaluate to a function taking 1 arguments
#include <iostream>
#include <string>

using namespace std;

class DXStartupEncoder {
public:
   void EncodeA(string& message) const { message = "A"; }
   void EncodeB(string& message) const { message = "B"; }
   void EncodeC(string& message) const { message = "C"; }
   void EncodeD(string& message) const { message = "D"; }
   void EncodeE(string& message) const { message = "E"; }
   void EncodeF(string& message) const { message = "F"; }
};

typedef void (DXStartupEncoder::*Encoder)(string&) const;
Encoder dn_sequence[] = {&DXStartupEncoder::EncodeA, &DXStartupEncoder::EncodeB, &DXStartupEncoder::EncodeC, &DXStartupEncoder::EncodeD };
Encoder queue_sequence[] = { &DXStartupEncoder::EncodeE, &DXStartupEncoder::EncodeF };


int main(int argc, char* argv[])
{
   for(int i = 0; i < sizeof(queue_sequence) / sizeof(queue_sequence[0]); ++i) {
      string param;
      queue_sequence[i](param);  //How to call function here???
      cout << param << endl;
   }

   return 0;
}
  • 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-11T14:27:23+00:00Added an answer on June 11, 2026 at 2:27 pm

    You don’t have function pointers, you have an array of pointer-to-member-function. You have to supply the this object when dereferencing a pointer-to-member.

    (obj.*queue_sequence[i])(param);  //obj must have type DXStartupEncoder
    

    Alternatively, since your functions are stateless, you can make them static and then use ordinary function pointers.

    typedef void (*Encoder)(string&) const;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting errors for the below code as (18) : error C2064: term
Below is the insert function in VC++. I am getting this error when I
i am getting the compile error: Error 7 error C2084: function 'Boolean IsPointInRect(...)' already
Getting 'Dispatcher has no subscribers' error while trying to post message to a channel
I am doing sample using DirectX 9 On Vs 2008/windows7. I am getting error.
Getting extremely confused with an adminhtml module i'm trying to write! Effectively I have
Getting message expected identifier in red for below these two statements } else if
Getting 401 errors when trying to use ASP.NET back end in load balanced environment
Getting this weird LINQ error. title = System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.Xml.Linq.XElement,System.String Here is the code I have:
I'm getting a compiler error with bind : using namespace std; bool odp(int arg1,

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.