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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:03:01+00:00 2026-05-23T03:03:01+00:00

When I try the below program its gives me the :error C2064: I tried

  • 0

When I try the below program its gives me the :error C2064: I tried in google but not able to find the exact reason. Please help.

class myClass 
{
    public:
        void function(myClass dTemp)
        {
            cout<<"Inside myClass: taking myClass parameter"<<endl;
        }
};

.

int main()
{

    myClass myClassTemp;
    myClass myClassTemp1;

    myClassTemp(myClassTemp1);// error C2064: term does not evaluate to a function taking 1 argument.

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-05-23T03:03:02+00:00Added an answer on May 23, 2026 at 3:03 am

    Did you mean to be able to call an object of type myClass like a function? You need to overload operator() for that:

    void operator()(myClass dTemp){
      // ...
    }
    

    If you instead wanted to call the function, well, you should actually do so:

    myClassTemp.function(myClassTemp1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

the code below gives compilation error when I try to create test t[2]; because
When I try to use the code below I get a duplicate variable error
I can fix the below exception with a try-catch loop but I cannot understand
I’m getting system error when I try to compile the code below on Visual
I get the following error when I try and execute the code down below.
Its very simple but somehow not working (weird!!). I have a List of a
I thought this would be pretty academic but its not. I'm trying to traverse
I have the below mail program. The problem is mail program runs successfully but
I am doing the below test to try and learn more about LINQ to
When I try to set the z variable in the code below, I get

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.