Can't get ifstream to work in C++
I'm trying to read a text file in a C++ program using an ifstream object but it keeps saying that it can't open the file. Here's a partial version of the code i'm using. Can anyone tell me why it's not reading the file? Am I missing a library or some other important part? The text file is in the same folder as my Xcode project file.
#include <vector>
#include <fstream>
#include <iostream>
#include <string>
#define FILE_IN "Pool LogData.txt"
using namespace std;
bool ReadFile(vector<string> & rvMonthYr, vector<int> & rvRecSwim,
vector<int> & rvLapSwim, vector<int> & rvLessons)
{
ifstream input;
input.open(FILE_IN);
//check that the file is open
if(!input)
{
cout << "\nSorry, there was a problem opening the file.";
return false;
}
iBook G4 Power PC 1.2GHz