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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:41:51+00:00 2026-06-14T02:41:51+00:00

very simple task for me here and I’m not sure why this is giving

  • 0

very simple task for me here and I’m not sure why this is giving me problems, I’m simply making two mockup classes try to compile without any logic in their methods whatsoever using headers and declarations already given to me. Honestly this is just a cut and paste job more than anything, and yet I still came across this golden nugget of love –

cbutton.cpp:11:44: error: default argument given for parameter 4 of ‘cio::CButton::CButton(const char*, int, int, bool, const char*)’ [-fpermissive]
cbutton.h:7:5: error: after previous specification in ‘cio::CButton::CButton(const char*, int, int, bool, const char*)’ [-fpermissive]
cbutton.cpp:11:44: error: default argument given for parameter 5 of ‘cio::CButton::CButton(const char*, int, int, bool, const char*)’ [-fpermissive]
cbutton.h:7:5: error: after previous specification in ‘cio::CButton::CButton(const char*, int, int, bool, const char*)’ [-fpermissive]
cbutton.cpp:19:41: error: default argument given for parameter 1 of ‘void cio::CButton::draw(int)’ [-fpermissive]
cbutton.h:11:10: error: after previous specification in ‘virtual void cio::CButton::draw(int)’ [-fpermissive]
cbutton.cpp:53:29: error: ‘virtual’ outside class declaration

Here are the files I’m working with. Thank you everyone, as always!

#include "cfield.h"

namespace cio{
  class  CButton: public CField{

  public:
    CButton(const char *Str, int Row, int Col, 
            bool Bordered = true,
            const char* Border=C_BORDER_CHARS);
    virtual ~CButton();
    void draw(int rn=C_FULL_FRAME);
    int edit();
    bool editable()const;
    void set(const void* str);
  };
}    




#include "cbutton.h"

namespace cio {  

  CButton::CButton(const char *Str, int Row, int Col, 
          bool Bordered = true,
          const char* Border=C_BORDER_CHARS){

  }

  void CButton::draw(int rn=C_FULL_FRAME){

  }

  int CButton::edit(){

    return 0;
  }

  bool CButton::editable()const {

  return false;
  }

  void CButton::set(const void* str){

  }

  virtual CButton::~CButton(){

  }
}
  • 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-14T02:41:53+00:00Added an answer on June 14, 2026 at 2:41 am

    You specified a default argument in the definition of the function, while they already had a default argument in the class declaration. You can declare default arguments in the class declaration or in the function definition, but not both.

    EDIT: Missed the end of your errors: error: ‘virtual’ outside class declaration. It’s a rather clear compiler error: virtual keywords belongs to class declarations, not function definitions. Simply remove it from the definition of your destructor.

    Corrected source:

    namespace cio {  
    
      CButton::CButton(const char *Str, int Row, int Col, 
              bool Bordered, // No default parameter here,
              const char* Border){ // here,
    
      }
    
      void CButton::draw(int rn){ // and here
    
      }
    
      CButton::~CButton(){ // No virtual keyword here
    
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a homework task, but it's very simple. The task comes with a
Trying to perform a very simple task here. I have an <ol> that contains
I have a simple task to accomplish, but I am not sure what is
I am trying to do a very simple task here, I would like to
I have a very simple task: add the contents of a textField to an
I have a very simple task I am trying to do in Groovy but
I'm having some trouble doing a very simple task. I have a rich textbox
I'm trying to accomplish what should be a very simple task using the ListView
Very simple question. I need to perform a task when the user closes his
Very Simple one, just stumped on syntax and not finding a good example anywhere.

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.