I am trying to open these two files and read their contents into two different arrays, but whenever I try and open them I get the unable to open file dialog? I don't see anything incorrect but I am not a strong c++ user.
std::ifstream inFile; inFile.open("fives.txt"); if (inFile.is_open()) { while (! inFile.eof() ) { getline (inFile,line); fives[loop] = line; cout << fives[loop] << endl; loop++; } inFile.close(); } else cout << "Unable to open file"; inFile.open("search.txt"); loop=0; if (inFile.is_open()) { while (! inFile.eof() ) { getline (inFile,line); search[loop] = line; cout << search[loop] << endl; loop++; } inFile.close(); } else cout << "Unable to open file";
ifclauses is triggering the message?