I try to write program to manage Store. it has some users and goods and Order. this is my User.h, Good.h files:
User.h:
#ifndef _USER
#define _USER
#include "Store.h"
#include "Good.h"
namespace question1
{
class User
{
const Store store;
public:
User(Store &s) : store ( s )
{
}
};
class AdminUser:User
{
};
class DeliveryUser:User
{
};
class OrderUser:User
{
void registerOrder(Order &o);
};
class ReceptionUser:User
{
void importGood(Good &g);
void increaseGood(Good &g);
};
}
#endif
and Good.h:
#ifndef _GOOD
#define _GOOD
#include <string>
#include <vector>
#include "User.h"
namespace question1
{
class Date
{
public:
Date ();
Date ( int mn, int day, int yr); // constructor
void display(); // function to display date
int GetMonth();
void SetMonth(int mn);
~Date();
private:
int month, day, year;
int DaysSoFar();
};
enum Ordertype{Newly_registered, Check, Answered};
class Order
{
int num;
std::string customerName;
Date registered, Check;
Ordertype type;
std::vector<int> codelist, numlist;
public:
Order();
Order(Order& o);
};
class ImportDate
{
Date importDate;
User importer;
int num;
};
class ExportDate
{
Date exportDate;
User exporter;
int num;
Order ex;
};
class Good
{
std::string name;
int code;
Date in;
int innum, AvailableNum;
User importer;
std::vector<ImportDate> importHistory;
std::vector<ExportDate> exportHistory;
public:
Good();
Good(Good &g);
};
int max (int a, int b)
{
if (a>b) return(a) ; else return (b);
}
int min (int a, int b)
{
if (a>b) return(b); else return (a);
}
}
#endif
but when compile just this two codes, i got error in User File that
"syntax error : identifier 'Order', Line 28
"syntax error : identifier 'Good', Line 33
"syntax error : identifier 'Good', Line 34
in the function parameter list. I use visual studio 2010. and open empty project.
anybody can help me?