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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:29:00+00:00 2026-06-18T17:29:00+00:00

In C++ (Microsoft Visual Studio), I have: main_savitch_4::string::string(const char str[ ] = ) in

  • 0

In C++ (Microsoft Visual Studio), I have: main_savitch_4::string::string(const char str[ ] = “”) in mystring.h and added to in mystring.cpp:

main_savitch_4::string::string(const char str[ ] = ""){
    allocated = 0;  
    current_length = 0;
    start = new char[0];
}, which defines the private variables. 

I get the following errors:

c:\users\erice\documents\c++_2\lab04\rice_lab04_2\rice_lab04_2\mystring.cpp(13): error C2572: 'main_savitch_4::string::string' : redefinition of default parameter : parameter 1
1>          c:\users\erice\documents\c++_2\lab04\rice_lab04_2\rice_lab04_2\mystring.h(88) : see declaration of 'main_savitch_4::string::string'
1>.  

What exactly is going wrong??? I don’t understand what = means in a function description

  • 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-18T17:29:01+00:00Added an answer on June 18, 2026 at 5:29 pm

    The compiler is telling you that you have the default parameter in the declaration and definition of the function. Remove it from the definition:

    main_savitch_4::string::string(const char str[ ]) { ... }
    

    I don’t understand what = means in a function description

    It means you are providing a derfault parameter to a function. For example,

    void foo(int i = 42); // declaration
    

    The above means you can call foo without a parameter:

    ....
    void foo(int i) { return i+100; } // definition
    
    // call the function
    foo(); // calls it as foo(42);
    foo(123);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Microsoft Visual Studio 2008 on Windows/XP. I am trying to install a
I am newbie to Windows Azure application. I have downloaded the Microsoft Visual Studio
I have a test project in Visual Studio. I use Microsoft.VisualStudio.TestTools.UnitTesting . I add
I have the following C program compiled in Microsoft Visual Studio Express 2012: int
Okay, this is getting stupid, I have Microsoft Visual Studio 2008, was working fine,
I have Microsoft Visual Studio 2010 on Windows 7 64bit. (In project properties Character
I want to design one simple form with Microsoft Visual Studio, I have one
What have I done? I'm using Microsoft Visual Studio 2010 1) I downloaded libevent-2.0.16-stable
I have installed Visual Studio Express 2012 and I have added cl.exe to my
Using C# for a console program in MicroSoft Visual Studio 2010, I have made

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.