Комментарии:
Can we write this same program in a linux system
Ответитьbest sources of code. thank you portfolio courses and thank you Kevin browne.
ОтветитьThanks, nice explanation
ОтветитьGreat explanation - really turned the light on for me without overloading it with all the bells and whistles - thank you!
ОтветитьWhat about like strerror_s?
ОтветитьThanks a lot ! I was trying to figure out how to do a log file for my programm and you answered almost all my questions !
ОтветитьGreat explanation! Clear and concise, keep up the good work! ☺
ОтветитьIt's best practice to save errno right after the function call. Many of the functions called in the example also set errno. The function fopen is easy because the return value tells you that you have an error. In many functions the return value says you might have an error and you need to check errno, e.g. strtol. In these cases you want to set errno to zero before the call.
ОтветитьHow does errno know that what failed was file opening? I know you put "if (fh == NULL)" there, but how does it know that file opening failed and not something else? Who sets the errno value
Ответить