I get an error in the following code, it worked fine in visual studio, but as soon as I moved it to Xcode, which uses gcc to compile, get this error. There is no corresponding constructor to initialize "ifstream". I looked at adding this as a link, not a copy offered on this site, but she still came up with an error.
void getAndSetTextData::GetBannedList(string fileName)
{
bannedWordCount = 0;
ifstream inFile(fileName);
while(inFile >> currentWord)
{
bannedWords.push_back(currentWord);
bannedWords[bannedWordCount++] = currentWord;
}
inFile.close();
}
Any help would be appreciated.
source
share