I'm having trouble opening a file using fopen in C++. I'm using XCode 4. Here's my code:
FILE *f; f = fopen("test.txt", "r"); if (f == NULL) std::cout << "Error: NULL file";
When I run this, the error message gets printed. test.txt is stored in the same directory as my XCode project. I just want to be able to read from test.txt hence the "r."
Any tips? Thanks.