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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:34:09+00:00 2026-05-26T10:34:09+00:00

I am creating a class called SelectionPage. Which essentially is a set of menues.

  • 0

I am creating a class called SelectionPage. Which essentially is a set of menues.

However, when i compile the code, the compiler gives me the following error:

g++ C_Main.cpp C_HomePage.cpp C_SelectionPage.cpp C_MemberManagement.cpp -o Project
C_SelectionPage.cpp:9:104: error: expected initializer before ‘SelectionPage’
make: *** [Project] Error 1

Here is The first few lines of C_SelectionPage.cpp:

#include "H_SelectionPage.h"


//Constructor for the SelectionPage class
//It assigns "managing" which decides if the user
//is a manager or not.
SelectionPage::SelectionPage(
    int newPoints,
    string newManager,
    string newLoginName,
    string MemberFile)
        SelectionPage(
            int newPoints,
            string newManager,
            string newLoginName,
            string MemberFile)
    {
        points = newPoints;
        manager = newManager;
        loginName = newLoginName;
        flatMemberList.clear();
        //Create Object Governing Flat Members.
        memberList = MemberManagement temp(MemberFile);
}

And here is the declaration of the constructor in the header file:

SelectionPage(
    int newPoints,
    string newManager,
    string newLoginName,
    string MemberFile);

Could someone please explain to me why i am getting an error?

Thanks in advance.

  • 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-26T10:34:09+00:00Added an answer on May 26, 2026 at 10:34 am

    If you have this line really in your code, you probably copied the constructor twice:

    SelectionPage::SelectionPage(int newPoints, string newManager, string newLoginName, string MemberFile )SelectionPage( int newPoints, string newManager, string newLoginName, string MemberFile){
    

    Should be this:

    SelectionPage::SelectionPage(int newPoints, string newManager, string newLoginName, string MemberFile ){
    

    The compiler complains about intializer list because that’s what should follow the header, not another copy of the parameter list.

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

Sidebar

Related Questions

I just found myself creating a class called InstructionBuilderFactoryMapFactory. That's 4 pattern suffixes on
I'm creating an air traffic control system. I have a class called plane that
When creating a class that has internal private methods, usually to reduce code duplication,
I'm working on creating a class file called MyClass - it works fine when
was thinking about creating a Single class called 'Request' to handle and clean POST
I'm creating an instance of a class called S3ObjectController (S3OC) that has one method
I'm just learning C++ and programming. I'm creating a class called Distance . I
I am creating a class in C# called Robot, and each robot requires a
I am creating an app to manage homework, and have a class called Assignment.
I'm having some trouble creating an object in C++. I create a class called

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.