I am trying to run this but the file is constantly failing to load. What I am trying to do is load a dictionary into an Array with each level of an array accounting for one word.
#include <iostream> #include <string> #include <fstream>> #include <time.h> #include <stdlib.h> using namespace std; int Rand; void SetDictionary(){ srand(time(NULL)); Rand = rand() % 235674; fstream file("Hangman.txt"); if(file.is_open()){ string Array[235675]; for(int X = 0; X < 235673; X++){ file >> Array[X]; } cout << Array[Rand]; }else{ cout << "Unable To Open File\n"; } } int main(){ SetDictionary(); }