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
Post a Comment