How can I tell the program to stop using freopen

后端 未结 2 1655
离开以前
离开以前 2021-01-26 19:25

I am beginner in C++ and I have a question that is beyond my limits. I compile under GNU GCC. I use

#include

also known as:

2条回答
  •  粉色の甜心
    2021-01-26 20:03

    In windows,

    freopen("CON","r",stdin);
    

    this code worked for me. It switches the stdin to console.
    P.S: The text file used to take input before this, must be ended with a newline.

提交回复
热议问题