Help needed with error ASAP!!

#include<iostream>
#include<string>
#include<array>
using namespace std;
struct birth_date
{
int Day;
int Month;
int Year;
}a,b;

struct customer_name
{
string First_name;
string Middle_name;
string Last_name;
};

class Customer
{
private:
struct Date;
struct Name;
float Balance_saving;
float Balance_checking;
public:
float amount;
int accountType;

void deposit()
{

float amount;
int accountType;
};

void withdraw()
{

float amount;
int accountType;
};
void ckeckingBalance()
{
cout << "Account Balance: ";
};
Customer( );
{
Date get_date(){ return m_date;};
int getDay(){return m_date.day;};
int getMonth(){return m_month.day;};
int getYear(){return m_date.year};
};

Customer(Date birth_date, Name customer_name, float initial_saving, float initial_checking);

};

int main()
{
Customer x;
birth_date y;
y= x.get_date();
cout<<y.Day<<y.Year<<y.Month;
system ("pause");
return 0;
}
This is my code and for some reason i get two errors at the bold lines
the two errors are
1: intellisense: expected a declaration line 48
2: intellisense: Class "customer" has no member "get_date" line 63

ALL the help would me much appriciated.
THANK YOU!
Please use code tags when posting code here.

For some reason, you've defined your accessor methods in a separate code block - i.e. you've enclosed them in braces:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Customer
{
private:
  // ...
public:
  // ...
  {
    Date get_date(){ return m_date;};
    int getDay(){return m_date.day;};
    int getMonth(){return m_month.day;};
    int getYear(){return m_date.year};
  };

// ...
};


I'm genuinely unsure as to what the effect of this will be, but it's possible that this is causing the definition of those methods to be only within the scope of that block. It's confusing me, and it may well be confusing Intellisense as well.

Also, you've declared two constructors for Customer, but I don't see any definition anywhere of what they do. That won't work.
Last edited on
Topic archived. No new replies allowed.