What is the working directory of my C++ program? [duplicate]
问题 This question already has answers here : How do I get the directory that a program is running from? (24 answers) Closed 2 years ago . I am trying to get my program to read a file and use the file as input information. I put the file in the same directory as my program , but still nothing. Here is my code: int main() { ifstream inFile; inFile.open("inData.txt"); if (inFile.fail()) { cout << "file did not open please check it\n"; system("pause"); system("exit"); } studentType sList[20]; getData