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


this happening in both visual studio , 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 not opening. text file matrices.txt in same directory.

what "same directory" in context?

for file open this, has in working directory of executable when run in debugger.

for xcode; means adding files copy files build phase (accessible editing executable's target); , adding products directory, selected dropdown.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -