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 have a varargs function which accepts a float parameter
I have a varargs function which accepts a float parameter. Why isn't
va_arg(argp, float)
working?
✍: Guest
In the variable-length part of variable-length argument lists, the old ``default argument promotions'' apply: arguments of type float are always promoted (widened) to type double, and types char and short int are promoted to int. Therefore, it is never correct to invoke va_arg(argp, float); instead you should always use va_arg(argp, double). Similarly, use va_arg(argp, int) to retrieve arguments which were originally char, short, or int. (For analogous reasons, the last ``fixed'' argument, as handed to va_start, should not be widenable, either.)
2015-06-08, 1515👍, 0💬
Popular Posts:
How To Export Data to a CSV File? - Oracle DBA FAQ - Introduction to Oracle SQL Developer If you wan...
What's wrong with this initialization? char *p = malloc(10); My compiler is complaining about an ``i...
What will be printed as the result of the operation below: main() { int x=10, y=15; x = x++; y = ++y...
What Information Is Needed to Connect SQL*Plus an Oracle Server? - Oracle DBA FAQ - Introduction to ...
How To Blend a Color Layer to a Image? - PSP Tutorials - Fading Images to Background Colors with PSP...