Hello, I'm working with files in a C++ project AND the text file that I need to open is in the same directory, however when just trying to open it like this:
string inputFile = "myText.txt";
It will not open, even though it's in the same directory, so then I have to put the file location (the directory path) which is fine BUT other people will be using this application and won't have access to my directory..
I want something that shows the current directory, like in C# there's a function for this.. I can't seem to find the same one in C++ so I've been working with this:
#include <stdio.h>
#include <dirent.h>
#include <iostream>
using namespace std;
int main (int c, char *v[]) {
DIR * mydir = opendir(".");
cout << mydir;
return 0;
}
But it just shows me the memory location, even if I have &mydir
Any suggestions? =)