How to read the txt file in the same directory when you run the exe file in the directory set in PATH .
int main(int argc, char* argv[])
{
cout << "Start" << endl;
for (int index = 1; index < argc; index++)
cout << argv[index] << " ";
cout << endl;
ifstream readFile("test.txt");
if (readFile.is_open())
{
string str;
for (; !readFile.eof();)
{
readFile >> str;
cout << str << endl;
}
readFile.close();
}
else
{
cout << "faile open file" << endl;
}
cout << "End" << endl;
}