dictionary.cpp

来自「一个拼写检查程序」· C++ 代码 · 共 12 行

CPP
12
字号
#include "dictionary.h"
#include <fstream>

Dictionary::Dictionary(string filename)		//构造函数,把文件中的所有单词插入到Dictionary中
{
	string the_word;
	ifstream in(filename.c_str());			//获取文件输入流
	while(getline(in, the_word)){			//从输入流中获取单词
		this->insert(the_word);				//向Dictionary中插入单词
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?