Hi friends
im trying to get my menu working but i just cant seem to get it working ... these are my 3 errors
9 " In file included from main.cpp"
47 " no matching function for call to `Menu::Menu(const char[7])' "
49 "std::string' has no member named 'add' "
This is my code
-------------------------------------------------------------
//main.cpp
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <cstdlib>
#include "Menu.h"
using namespace std;
int main(){
{
cout<<"Testing First"<<endl;
}
system("pause");
return 0;
}
------------------------------------------------------------------
----------------------------------------------------
//menu.h
#ifndef H_MENU
#define H_MENU
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <cstdlib>
using namespace std;
struct Menu
{
std::string name; //could be menu name or a item name
std::vector<Menu> subMenus;
Menu(const std::string& name, const std::vector<Menu> subMenus): name(name), subMenus(subMenus){}
void add(const Menu& m){ subMenus.push_back(m);
}
};
class SportsClothingMenu
{
private:
string sportsClothingMenu;
public:
SportsClothingMenu(){}
private:
void _populate(){
Menu soccerClothesMenu("soccer");
//...add soccor clothes to soccerClothesMenu
sportsClothingMenu.add(soccerClothesMenu);
}
};
#endif
please help me