當前位置:成語大全網 - 成語詞典 - 怎麽樣用C++設計壹個詞典類Dic,其中包含若幹單詞信息,每個單詞由英文單詞及對應的中文含義

怎麽樣用C++設計壹個詞典類Dic,其中包含若幹單詞信息,每個單詞由英文單詞及對應的中文含義

#include <map>

class Word

{

public:

World();

// ...

protected:

std::string m_english;

std::string m_chinese;

//std::string m_;....

// => std::vector<std::string> m_info;

};

class Dictionary

{

public:

Dictionary();

//....

void Query(std::string word);

protected:

std::map<std::string, class Word> m_wordTable;

//...

};