Not that I managed to figure out the cause, but there seems to be a few things that might cause problems. It seems to get into an endless loop. Some cout statements may help to find out where. But better read on.
The worst of these seems to be that you are starting indexing both at 0 and 1, this is really confusing. This is also probably the reason why I see a +1 in a rand() call: 0-based indexes work really nicely with the % operator, while 1-based require hard work.
Try to get used to and follow the convention that in C++ all arrays start at index 0, and index a[SIZE] is one beyond the end of the array. Works really nice with %: rand() % SIZE; gives you always a valid index.
All ranges (as in random_shuffle arguments) include the first element, and the end of the range is one beyond the end of it.
If you break these rules, it is very easy to get into trouble.
What you could do:
make a copy of the program that is runnable without user input. I suppose the error happens at random places and with your random shuffling, so it is easier to debug if you can just let it run and see what happens.
Or a much-much better idea: throw away a large part of the code and do all the random shuffling (both the list of the words and separate words) using std::random_shuffle() from <algorithm>.
Code:
#include <string>
#include <algorithm>
#include <iostream>
int main()
{
std::string a("CUCUMBER");
std::string b(a);
std::random_shuffle(b.begin(), b.end()); //see how easy it can be
std::cout << a << '\n' << b << '\n';
std::cin.get();
}
With this method, you'll need a simple struct for starters, to keep the word and the hint together, so they won't end up in different order if each are in a separate array. (Shuffle the questions once, then draw them one after another from the array. Things like can_use complicate things - and may be the readon of the lockup.
Code:
#include <cstdlib>
#include <ctime>
#include <string>
#include <algorithm>
#include <iostream>
struct WordKey
{
std::string word;
std::string key;
};
int main()
{
srand(time(NULL)); //random_shuffle uses rand(), seed yourself
const int MAX = 3;
WordKey word_list[MAX]; //std::vector is safer
//I would consider reading these from a file
word_list[0].word = "hello";
word_list[0].key = "A common greeting";
word_list[1].word = "need";
word_list[1].key = "Another word for requirement";
word_list[2].word = "death";
word_list[2].key = "The end of life";
std::random_shuffle(word_list, word_list+MAX); //here you go
for (int i = 0; i < MAX; i++) {
std::cout << word_list[i].key << ": " << word_list[i].word << '\n';
}
std::cin.get();
}
Breaking your code up into smaller functions is also a Good Thing. Your main loop is enormous and does a lot of meaningless work (initializing the same data all over and over). This program should look something like that:
Code:
// initialize data, from file or hard-coded
// random_shuffle words and keys
while (still_have_questions) { //main game loop
//random_shuffle word
//display question
// get user input
// evaluate user input
}
//sorry out of questions, good-bye