Greetings all !
I have a piece of sample code from an open library. It was supposedly written for msvs, but I am using codeblocks with mingw compiler on a windows 7 machine.
The error I get is : error: 'errno_t' was not declared in this scope|
I searched online for what to do with errno_t, but all I figured out is about its purpose. What can I do to fix this and make the program work ? Thank you.
Kind regards, T
By using the typedef keyword, you make err a type instead of a variable.
However, in this case since you immediately assign to the variable, you can forget about the data type and let the compiler figure it out for you: auto err = fopen(&infile, infilename, "r");
Though, really, if you are going to use C++ at all, you should use it completely and ignore C:
There's generally no use for detailed error information except in specialized cases. For the most part, your only concern is whether you could open the file or not.