Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
I came across some code that puts a (void) cast before each call to printf. Why?
I came across some code that puts a (void) cast before each call to printf. Why?
✍: Guest
printf does return a value (the number of characters printed, or an error code), though few programs bother to check the return values from each call. Since some compilers (and lint) will warn about discarded return values, an explicit cast to (void) is a way of saying ``Yes, I've decided to ignore the return value from this call, but please continue to warn me about other (perhaps inadvertently) ignored return values.'' It's also common to use void casts on calls to strcpy and strcat, since the return value is never surprising.
2015-05-13, 1309👍, 0💬
Popular Posts:
Can you explain the fundamentals of “GetGlobalResourceObject ”and “GetLocalResourceObject” function...
How To Check the Oracle TNS Settings? - Oracle DBA FAQ - ODBC Drivers, DSN Configuration and ASP Con...
How To Display a Past Time in Days, Hours and Minutes? - MySQL FAQs - Managing Tables and Running Qu...
How do I use a scriptlet to initialize a newly instantiated bean? A jsp:useBean action may optionall...
Why is it preferred to not use finalize for clean up? Problem with finalize is that garbage collecti...