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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:08:31+00:00 2026-06-10T17:08:31+00:00

I get the following error and I cannot figure out why: Could not find

  • 0

I get the following error and I cannot figure out why:

Could not find a match for 'PEmployee::PEmployee(char *, double)' in function main()

Here’s my code:

class PEmployee
{
    public:
        PEmployee();
        PEmployee(string employee_name, double initial_salary);
        void set_salary(double new_salary);
        double get_salary() const;
        string get_name() const;
    private:
        Person person_data;
        double salary;
};

int main()
{
    PEmployee f("Patrick", 1000.00);
    cout << f.get_name() << " earns a salary of ";
    << f.get_salary() << endl;
    return 0;
}

Can somebody tell me why I get this error?

Thanks.

  • 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-10T17:08:32+00:00Added an answer on June 10, 2026 at 5:08 pm

    The constructor for std::string with type char * is not explicit, so I don’t know why you would get that error. The compiler should recognize that it can create a std::string on the fly for you.

    From http://en.cppreference.com/w/cpp/string/basic_string/basic_string:

    basic_string( const CharT* s,
    const Allocator& alloc = Allocator() );

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

Sidebar

Related Questions

I get the following error: org.dbpedia.spotlight.exceptions.ConfigurationException: Cannot find spotter file ../dist/src/deb/control/data/usr/share/dbpedia-spotlight/spotter.dict at org.dbpedia.spotlight.model.SpotterConfiguration.<init>(SpotterConfiguration.java:54) at
I get the following error within Magento CE 1.6.1.0 Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot
In the below sql statement i get the following error Cannot use an aggregate
When using textbox.Undo(); I get the following error: Cannot Undo or Redo while undo
I get the following error when running mongo-hadoop streaming: java.io.IOException: Cannot run program "mapper.py":
When I run make (after running qmake) I get the following error: /usr/bin/ld: cannot
I cannot compile python in pydev in eclipse. I get the following error: unable
I get following error (SyntaxError): missing ] after element list when using eval function.
I get the following error when compiling the std::find_if function: error C2451: conditional expression
Upon launching a sinatra app, I get the following error message: /home/matt/.rvm/gems/ruby-1.9.3-p125/gems/backports-2.5.1/lib/backports/tools.rb:310:in `require': cannot

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.