I tried to use freopen() for File I/O. However there is a discrepancy with the module. The module says that you need the header file cstdio to use this method. I have attached a screenshot below:
But when I then use this, I get a compilation error. Furthermore, in the same module, the solution to the fence painting problem does not include the cstdio header file. I have shown the authors solution below:
When I use exactly the authors solutions but do include the header file, I get a whole host of errors to do with scope mostly.
So, I am not going to include the cstdio header file when using freopen() for File I/O.
So is the module wrong? (not the solution)