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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:16:37+00:00 2026-06-18T01:16:37+00:00

So here is my header: //warehouse.h #ifndef WAREHOUSE_H #define WAREHOUSE_H #include<string> #include<map> #include dates.h

  • 0

So here is my header:

//warehouse.h
#ifndef WAREHOUSE_H
#define WAREHOUSE_H
#include<string>
#include<map>
#include "dates.h"

namespace a4
{
  class warehouse
  {
      public:
          warehouse(std::string name, std::string start_date);

      private:
          std::string name;
          std::string busiest_day;
          int most_transactions;
          dates current_date;
          std::map<std::string, a4::food> items;
          void next_day();

  };
}
#endif

My .cc:

//warehouse.cc
#include "warehouse.h"
#include "dates.h"
namespace a4
{
 //constructor
 warehouse::warehouse(std::string wname, std::string start_date)
 {
     wname = name;
     current_date = dates(start_date);

 }
 void warehouse::next_day()
 {
     current_date.next_day();
 }
}

And the compiler error:

warehouse.cc: In constructor ‘a4::warehouse::warehouse(std::string, std::string)’:
warehouse.cc:6: error: no matching function for call to ‘a4::dates::dates()’
dates.h:10: note: candidates are: a4::dates::dates(std::string)
dates.h:8: note:                 a4::dates::dates(const a4::dates&)

From the error it looks like its calling a zero argument constructor instead of the constructor that takes a string. The dates class i built doesn’t have a zero argument constructor obviously.

Ive been trying to figure this out for hours any help would be appreciated. In a similar question I was told to look up member initializer lists. I have and don’t really understand how to implement it right I guess, cause it doesn’t seem to solve the problem.

Were only a few weeks into the semester and this is my first class on c++, go easy on me 🙂

  • 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-18T01:16:38+00:00Added an answer on June 18, 2026 at 1:16 am

    It’s because you have dates current_date; as a member of warhouse. When warhouse‘s constructor is called, the default constructors of all its member variables will be called. You can change the constructors any member variables use with : notation (creating an initializer list):

    warehouse::warehouse(std::string wname, std::string start_date)
        : current_date(start_date)
    {
        wname = name;
    }
    

    Or by simply defining a blank constructor for dates.

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

Sidebar

Related Questions

Here's my header file Normal.h: #ifndef NORMAL_H #define NORMAL_H #include Vector3.h class Normal {
Here's the problem html: <ul id="update-list"> <li class="update" onclick="window.location('some_url')"> <h2> some header </h2> <p>
see Name and Email input boxes in header see here
GithubLink https://github.com/leomdmfiel/Assignment/tree/master/BankManager/BankManager First here's my header: class List { protected: Node* head; public: List(object
if (condition) { #lol. Some code here } else { header(Location:/);//i'm trying to redirect
Im having a big headcache with a header design: Here the demo: http://jsfiddle.net/uGECm/ The
Here is my try: @header(Content-type: text/html; charset=utf-8); @header(Location:/index.php); @header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 @header(Expires:
Here's a sample column of my data frame, RR is a header : RR
I've noticed from here that the contents is only the header Revision 16532: /tags/3.3.2.SR1/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller
I know I'm being lazy here and I should trawl the header files for

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.