Hi, I am new to CP. I recently started studying for Bronze, though I still do not really understand the input and outputting file syntax and meaning for the C++ statements. For example,
freopen(“square.in”, “r”, stdin);
freopen(“square.out”, “w”, stdout);
It says that “square” is the file name. But which file name? Is it the name before the .cpp file. That one? Or does it represent something else? Also, what is the actual purpose of these two lines, since I am still a tad bit confused after reading some online C++ forums. Any help will be much appreciated. Thanks.
If those lines are included, your program will read from a file named square.in
and write to a file named square.out
. The name of your .cpp
file is irrelevant.
If you have installed C++ on your device, you can verify that this is the case.