Hello,
I cannot read a file, config.cfg, in the current directory on MacOS X 10.6.
I'm running a console app.
Can anybody tell me what I'm doing wrong? (By the way the getline() function returns no string.)
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(int argc, char **argv) {
std::string xpstr;
std::ifstream myReadFile;
myReadFile.open("./config.cfg");
getline(myReadFile, xpstr, '\n');
std::cout << xpstr.c_str();
myReadFile.close();
return 0;
}