mercredi 15 juin 2016

Why isn't my file opening, C++? XCode and Visual Studio


This is happening in both Visual Studio and XCode

#include <fstream>
#include <iostream>

using namespace std;

int main() {

    ifstream input;

    input.open ("matrices.txt");

    if (!input.is_open()) {
        cout << "not open!";
    } else {
        cout << "open!";
    }

    input.close();

    return 0;
}

My file is not opening. The text file matrices.txt is in the same directory.


Aucun commentaire:

Enregistrer un commentaire