mercredi 21 octobre 2020

I need to make a function that drags a random word from my wordlist in cpp [closed]

This is what my code looks like currently i get two errors one with the RandomWord>>Wordlist line and another when I try and close random word.

int main(){
char guess;
int stage;//how many tries the person has to guess correctly
string WordList[10];//array of 10 words
char word[21];
char underScores[21];
char alphabet[27] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
bool userGuesses[26];
char userInput;
bool runAgain;
ifstream RandomWord;
srand(time(NULL));
RandomWord.open("wordbank.txt");
RandomWord >> WordList; 
RandomWord.close();

Aucun commentaire:

Enregistrer un commentaire