Piping input into a c++ program to debug in Visual Studio

前端 未结 2 1635
梦如初夏
梦如初夏 2020-12-09 04:17

this has probably been asked before, but I haven\'t been able to find any answers so far. I\'m trying to start my program up with multi-line input, I.E. something I don\'t w

2条回答
  •  不思量自难忘°
    2020-12-09 04:46

    You may save your input as a file.(like "intput.txt"). Then call

    freopen("intput.txt", "r", stdin);
    //code to read from stdin.
    fclose(stdin);
    

提交回复
热议问题