- SM Ryan http:/ /www.rawbw.com/~wyrmwif/ 留给天主教徒来破坏生存。Christian Bau <ch***********@cbau.freeserve.co.uk> wrote:# In article <11**********************@g44g2000cwa.googlegroups .com>,# "whatluo" <wh*****@gmail.com> wrote:## > Hi, c.l.cs# ># > I noticed that someone like add (void) before the printf call,# > like: (void) printf("Timeout\n"); while the others does''t. So# > can someone tell me whether there any gains in adding# > (void) to printf.## printf returns a value.## When a function returns a value, and the programmer ignores the code, I# would want to know why. There are usually two explanations: The# programmer made a mistake ignoring the return value, or the programmer# did ignore the return value on purpose. When you writeI routinely notice lots of people checking the return of printfinstead of simply looking at the terminal window.--SM Ryan http://www.rawbw.com/~wyrmwif/Leave it to the Catholics to destroy existence. 这篇关于(void)printf vs printf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-01 09:33