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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:11:53+00:00 2026-06-17T19:11:53+00:00

Note: I’m using Visual Studio 2010. There are two important classes here, Date and

  • 0

Note: I’m using Visual Studio 2010.

There are two important classes here, Date and Directory.

class Date
{
private:
    int month, day, year;
public:
    Date();
    Date(int month, int day, int year);
};

class Directory : public [Superclass]
{
private:
    File* fileContents[50];
    Directory* dirContents[5];
public:
    Directory();
    Directory(char* name, 
        long size, 
        Date dateCreated, 
        Date dateModified,
        Date dateAccessed,
        int attributes);
};

I defined the constructors farther down – the Date constructor works just like you think it does. Now, I’m really new to C++, so I can’t even comprehend the error messages I’m getting. If I try to use the default constructor for Directory, I get this error message:

error LNK2019: unresolved external symbol "class Directory __cdecl d(void)" (?d@@YA?AVDirectory@@XZ) referenced in function _main

If I try to make it by using 3 Date objects, with this code:

int main()
{
    Date d1();
    Date d2();
    Date d3();
    Directory d("Hello", 12, d1, d2, d3, 0);
    cout << d;
}

These are my error messages:

error C2664: 'Directory::Directory(char *,long,Date,Date,Date,int)' : cannot convert parameter 3 from 'Date (__cdecl *)(void)' to 'Date'

IntelliSense: no instance of constructor "Directory::Directory" matches the argument list

EDIT: So, in a continuing effort to make zero sense to me, VS has decided to compile my program fine when the three Date arguments are created with Date da[3] and the arguments for the constructor are ("Hello", 12, d[0], d[1], d[2], 0).

  • 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-17T19:11:54+00:00Added an answer on June 17, 2026 at 7:11 pm

    According to the standard

    An object whose initializer is an empty set of parentheses, i.e., (),
    shall be value-initialized.

    [Note: since () is not permitted by the syntax for initializer,

    X a ();

    is not the declaration of an object of class X, but the
    declaration of a function taking no argument and returning an X. The
    form () is permitted in certain other initialization contexts (5.3.4,
    5.2.3, 12.6.2). —end note ]

    So, you need to change your declarations as follows

    int main()
    {
        Date d1;
        Date d2;
        Date d3;
        Directory d("Hello", 12, d1, d2, d3, 0);
        cout << d;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

{NOTE}: Visual Studio Dos support .ipp file. The problem here is more manual inefficiency
Note that the following code is in a class a single class private string
Note these things: I have Windows 8 RTM. I have Visual Studio 2012 RTM.
NOTE: This is a followup to my question here. I have a program that
NOTE: This is an old question and the answers here no longer works (since
Note: I had another similar question about how to GZIP data using Ruby's zlib
NOTE: The scenario is using 2 entity framework models to sync data between 2
Note: There is a similar question called 'installing nodejs on windows machine'. And various
Note, I am using c# MVC 3, I am trying to use this within
(Note: these two questions are similar, but more specific to ASP.Net) Consider a typical

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.