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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:13:02+00:00 2026-06-12T06:13:02+00:00

I am trying to use a delegated constructor and am trying to follow the

  • 0

I am trying to use a delegated constructor and am trying to follow the format found in this question and this question, however, I am still having issues.

My player.h file is this:

#ifndef PLAYER_H_
#define PLAYER_H_

#include <string>

class Player
{
public:
   Player(void);
   Player(std::string name, int score);
   ~Player();
protected:
   std::string name_;
   int score_;
};

#endif

My player.cpp file is this:

#include "player.h"
Player::Player(std::string name, int score)
{
   score_ = score;
   name_ = name;
}

Player::Player(void) : Player(NULL,0)
{

}

However, when I try to compile, I get the following error:

1>a:\projects\test\src\player.cpp(5): error C2614: 'Player' : illegal member initialization: 'Player' is not a base or member

What am I doing wrong? If it is relevant, I am using VS2012.

  • 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-12T06:13:03+00:00Added an answer on June 12, 2026 at 6:13 am

    If it is relevant, I am using VS2012.

    It is, because Visual Studio doesn’t implement this C++11 feature. Sorry. There are quite a lot of C++11 features they don’t implement.

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

Sidebar

Related Questions

I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I'm trying to add functionality to the v8sharp project and I'm having some issues
Lately I've been trying to follow the TDD methodology, and this results in lot
I'm trying to use delegates to cut down on my code in this project.
I'm trying to use an NSXMLParser to parse a property file that is related
I am trying to use the timer class in C# for this TCM Updater
I'm trying to use the delegate methods of NSURLConnection. The following methods are currently
I am trying to use the delegate method on a grid that I wrap
I am trying to learn on how to use delegates efficiently in C# and
i'm trying use facebook API to upload photo in my fan page. I downloaded

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.