Codeblocks IDE

In g++ we can directly read input from file like ./a.out<inputfile.txt
how to do the same in codeblocks?

@d1k5 , you can use freopen for the same in codeblocks.

Reading input from file - freopen(“Filename”, “r”, stdin)

Printing output to file - freopen(“Filename”, “w”, stdout)

just use them in your code and it will read input from file.

1 Like

thank you for reply!
but i know that method i just wanted to know whether is there any way like g++!