UFO Project: Random Codeword Selection Isn't Random

I’m attempting the optional objectives in the UFO Project, but can’t get my codewords to randomize. Currently my int random only outputs 1. I tried changing the rand() to rand() % 2 but it still only output 1 unless the value was changed manually.

std::vector<std::string> codeword_list {"codeacademy", "alphabet", "wrong"};
int random = rand() % codeword_list.size();
std::string codeword = codeword_list[random];

std::string answer;//underscores for displaying blanks in correct word
int misses = 0; //tally of missed guess attempts

for (int j = 0; j < codeword.size(); j++) {

  answer += "_";
}
std::cout << "RANDOM: " << random;

any help is appreciated cracking this!

Try calling srand first.
Here’s a reference for using srand with time, and then rand.