code compiles and works if i dont have my cout statement. but when i try to cout the front and top element of queue it compiles but has that debug error
Code:
void wordTest(string search, string temp, int i)
{
string word;
set<string> myset;
set<string>::iterator iter;
//string temp;
Stack<string> object;
queue<Stack<string>> myqueue;
ifstream infile;
infile.open("words.txt");
while (infile >> word)
{
myset.insert(word);
}
//cout << search << endl;
iter = myset.find(search);
if (iter != myset.end())
{
//Stack<string> object;
object.push(temp);
object.push(search);
myqueue.push(object);
}
//object.printStack(cout);
cout << myqueue.front().top();
infile.close();
}