I'm making a program and compiling it with g++ although I have a problem which I can't solve, It stops then says '.exe has stopped working', I'm trying to parse the text. So each word is added to the array 'LineArray' with the delimiters ' '',''.' although it's not working. Also when the program ends I get an std::bad_alloc error: what(): std::bad_alloc
std::ifstream FSFileParse(RunFile.c_str());
std::string Line;
std::string LineArray[50];
std::string c_s;
while (std::getline(FSFileParse, Line)) {
// Main loop
// Check each char
int i = 0;
for (char& c : Line) {
while (c != ' ' or c != ',' or c != '.') {
c_s += c;
}
LineArray[i] += c_s;
i++;
}
// Test if it works, remove when it is working
for (int x = 0; x == 4; x++) {
std::cout << "Array [" << x << "]: " << LineArray [x] << " ";
}