Ello. This code is not working as intended. I have my exe and in the same folder I have an inventories folder with text files. This code won't open inventories\Noa.txt. It creates a file called inventoriesNoa.txt in the same folder as my cpp files. I want it to properly navigate to the inventories\Noa.txt file and search in the same directory the exe is in. How do I do this?
#include <conio.h>
#include <fstream>
#include <iostream>
using namespace std;
int main()
{
ofstream out;
out.open("\inventories\Noa.txt");
if (!out.is_open())
{
cout << "The file could not be opened";
}
out << "hi";
getch();
return 0;
}