I am tring to convert std:string to char* in several way, however non of these work:
first way:
char* c_levelMapFile = new char[levelMapFile.length() + 1];
strcpy(c_levelMapFile, levelMapFile.c_str());
ifstream myfile(c_levelMapFile);
myfile.is_open(); // returns false
second way:
const char* c_levelMapFile = levelMapFile.append("\0");
ifstream myfile(c_levelMapFile);
myfile.is_open(); // returns false
So in both cases it fails. If I specify the input file manually, then it's working. So I guess the problem should be in conversion from std::string to char* and probably for some reasons it is not adding the terminating zero at the end of the c-stryle string.