Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Every time you visit for the FIRST TIME today... [Part 1]

Name: Anonymous 2013-10-20 22:56

Post a random function that you made. May be from any project you've done or make one impromptu.

Any QUALITY is allowed. No bullying!

Name: Anonymous 2013-12-26 22:45

>>153
Ok All of these are fucking stupid.
better use while((c = fgetc (f)) != EOF || (!feof (f) && !ferror (f))
No. K&R2 goes through the entire fucking book using the style used in >>152. Your scenario is ridiculous

you don't return something from that function, you should retrun void and in C11 you can add _Noreturn with the void
I need to return something or it would not have compiled since I used error in an expression and the value was not ignored.

what if *++argv == NULL?
Then fopen would have failed and error would have caught it.

In my opinion using a error function that destroys the progam is bad for two reasons:
Your opinion isn't bad practice. exit exists to be able to terminate the process from any function. Your code may have to look much worse if you insist on exiting through main.

you don't check the return value of fprintf, vfprintf, putchar
I don't need to check the return value. If it failed writing the output than nothing can be done. What am I going to do if it fails writing the error? Try writing another error?

you don't use GNU Style
GNU Style is shit.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List