File Error

Hello, I am working on an assignment and my program is not opening my file. Where am I going wrong?

1
2
3
4
5
6
7
8
9
10
11
12
13
  int main(){
    std::ifstream inData;
    inData.open("VehicleInput.txt");
    std::string myLine;
    if (inData.is_open()){
        while (inData) {
            std::getline (inData, myLine);
            std::cout << myLine << '\n';
        }
    }
    else {
        std::cout << "Couldn't open file\n";
    }
Topic archived. No new replies allowed.