MCQOPTIONS
Bookmark
Saved Bookmarks
→
C Programming
→
Floating Point Issues in C Programming
→
Can the fixed arguments passed to the function tha..
1.
Can the fixed arguments passed to the function that accepts variable argument list, occur at the end?
A.
Yes
B.
No
Answer» C.
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
is an array that holds information needed by and
The macro is used to initialise a pointer to the beginning of the list of fixed arguments.
The macro is used to extract an argument from the fixed micro argument list and advance the pointer to the next argument.
It is necessary to call the macro if is called in the function.
The macro is used to extract an argument from the variable argument list and advance the pointer to the next argument.
A function that receives variable number of arguments should use to extract arguments from the variable argument list.
A function that receives variable number of arguments should use to extract the last argument from the variable argument list.
Point out the error in the following program._x000D_ #include<stdio.h>_x000D_ #include<stdarg.h>_x000D_ _x000D_ int main()_x000D_ {_x000D_ void display(int num, ...);_x000D_ display(4, 12.5, 13.5, 14.5, 44.3);_x000D_ return 0;_x000D_ }_x000D_ void display(int num, ...)_x000D_ {_x000D_ float c; int j;_x000D_ va_list ptr;_x000D_ va_start(ptr, num);_x000D_ for(j=1; j<=num; j++)_x000D_ {_x000D_ c = va_arg(ptr, float);_x000D_ printf("%f", c);_x000D_ }_x000D_ }
Which header file should you include, if you are going to develop a function, which can accept variable number of arguments?
The macro va_arg is used to extract an argument from the fixed micro argument list and advance the pointer to the next argument.
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply