Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
How can f be used for both float and double arguments in printf? Aren't they different types?
How can f be used for both float and double arguments in printf? Aren't they different types?
✍: Guest
In the variable-length part of a variable-length argument list, the ``default argument promotions'' apply: types char and short int are promoted to int, and float is promoted to double. (These are the same promotions that apply to function calls without a prototype in scope, also known as ``old style'' function calls. Therefore, printf's %f format always sees a double. (Similarly, %c always sees an int, as does %hd.)
2015-06-17, 1010👍, 0💬
Popular Posts:
How To Enter Boolean Values in SQL Statements? - MySQL FAQs - Introduction to SQL Basics If you want...
Can you tell me how to check whether a linked list is circular? Create two pointers, and set both to...
Can you have virtual functions in Java? Yes, all functions in Java are virtual by default. This is a...
What is the difference between "printf(...)" and "sprintf(...)"? sprintf(...) writes data to the cha...
How To Get the Last ID Assigned by MySQL? - MySQL FAQs - Managing Tables and Running Queries with PH...