sorry, they hold the words i use for the hangaroo game im making, and tempwordhold was meant to be partially replaced by underscores randomly each time i run it. I already tried removing the srand and put it outside the loop but it still crashes
Until you know more about memory management and exactly what a pointer is, dont' use char arrays to hold strings. (And in fact I wouldn't even do it after you understand all of that unless you have compelling reason to).
Instead, use a string:
1 2 3 4 5 6 7 8 9
#include <string> // put this with your includes
std::string ANSWER = "STUDENT"; // make these strings instead of char pointers.
std::string tempwordhold = "STUDENT";
//...
//int len = strlen(ANSWER); // boo
int len = ANSWER.length(); // yay
You might have to change some other things in your program to get it to work with strings, but after you do that you should be good.