oh also, he introduced exceptions by claiming that in C there is no separation of normal behaviour and error handling
he then showed this code:<code>int main() {<br> FILE * pf;<br> int errnum;<br> pf = fopen("unexist.txt", "rb");<br> if (pf == NULL) {<br> errnum = errno;<br> fprintf(stderr, "Value of errno: %d\n", errno);<br> // C Library function perror()<br> perror("Error printed by perror");<br> // C Library function strerror()<br> fprintf(stderr, "Error opening file: %s\n", strerror(errnum));<br> }<br> else {<br> fclose(pf);<br> }<br> return 0;<br>}<br></code>
no...? the error-handling code is clearly separated!
if you want to keep it nice and clear, you just use early returns...