i am supposed to write a function based off of the code i have so far that can generate the 5 letter sequences that are 1 letter different from a givin input; also identify the sequences that actually works.
im not sure how to begin this but here is code so far: (wordTest is my function i just dont have anything in it)
Code:#include <iostream> #include <fstream> #include <string> #include <set> using namespace std; void wordTest(string); int main() { set<string> myset; set<string>::iterator iter; string word, search; ifstream infile; infile.open("words.txt"); while (infile >> word) { myset.insert(word); } for (iter = myset.begin(); iter != myset.end(); iter++) cout << *iter << endl; cout << "Enter word to search for: "; cin >> search; iter = myset.find(search); if (iter == myset.end()) cout << "That word is not in the set" << endl; else cout << *iter << " is in the set" << endl; wordTest(search); return 0; } void wordTest (string search) {



LinkBack URL
About LinkBacks



