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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:02:42+00:00 2026-06-15T18:02:42+00:00

I am trying to call constructor but it is not working. Code is something

  • 0

I am trying to call constructor but it is not working. Code is something like this:

// Event.h

class Event
{
  private:
    int Time;
    int Date;
  public:
    Event();
    Event(int t, int d)
}

// Event.cpp

Event::Event(){}

Event::Event(int time, int date){
Time=time;
Date=date;
}

//Now in another .cpp file I am trying to call constructor something like this:

Event eve;
eve(inputTime,inputDate); // inputTime and inputDate are inputs 4m user.
//Error is:  no match for call to â(Event) (Time&, Date&)â

Any suggestions…………..

  • 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-15T18:02:43+00:00Added an answer on June 15, 2026 at 6:02 pm

    This

    eve(inputTime,inputDate); 
    

    requires that your Event class have an operator()(something, somethingElse), which it doesn’t have. something and somethingElse would correspond to the types of inputTime and inputDate respectively, which are not specified in your question.

    Presumably you want to construct an Event using the two argument constructor, which you can do like this:

    Event eve(inputTime,inputDate);
    

    Since the error also mentions types Time and Date, you probably need to add a constructor that takes const references to those types, unless they can be implicitly converted to int.

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

Sidebar

Related Questions

I'm trying to call an accessor function in a copy constructor but it's not
Trying to set-up a call back function, but it's not working for some reason.
I am trying to call the constructor H, but for some reason its not
I m trying to call an object constructor into a runnable but Eclipse return
I'm trying to call the constructor of class B from class A by passing
I'm trying to call explicit constructor/destructor with traits in templatized function. template <int i>
I am trying to organize my code in Dojo but I, do not understanding
here I am trying to call overloaded constructor after some condition has met in
I'm trying to call a method from another class with a simple button in
I'm trying to call a function present in one class from another class by

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.