CLion standard input while debugging

后端 未结 4 1199
[愿得一人]
[愿得一人] 2021-02-03 23:41

What I\'m trying to do is basically:

./myProgram < myData.txt

While I\'m debugging with CLion IDE. I just can\'t find the option to do so.

<
4条回答
  •  说谎
    说谎 (楼主)
    2021-02-03 23:56

    For me, CLion creates the executable in a file called 'cmake-build-debug'. Check out my file structure in the pic.

    Then, I just opened up my terminal and went to the directory containing the executable and used this command to pipe in the text file:

    ./FirstProject < ../hw1.txt
    

提交回复
热议问题