i want to access methods and fields from class Product in class Menu. So i write the following code:
Menu.h
#include "Product.h"
class Menu{
public:
Menu(Product& prod);
Menu();
private:
Product product;}
Menu.cpp
#include "Menu.h"
Menu::Menu(Product& prod) { this->product = prod; }
Menu::Menu() {}
Product.h
#include "Menu.h"
Class Product{
public:
Product():
}
and i get the following error in Menu constructor: syntax error: identifier 'Product'.
i changed Menu constructor to:
Menu(const Product& prod)
but it didn't work too.
Anyone know how to solve it?