CODE RIDER | Module : 2 Handling a variable number of parameters | Test | - Learn with Ashiso

Come here to Learn Everything.

Breaking

Home Top Ad

Post Top Ad

Wednesday, June 16, 2021

CODE RIDER | Module : 2 Handling a variable number of parameters | Test |



COURSE RIDER | Module : 1 Evolution of C - from past to eternity | Test |


Q. Which of the following function headers is invalid?

And:- void  f0 (int  n,  . . . ,  char  *s)

Q. Which of the following snippets should be put into ther code to make it work properly?



Ans:-   v = sum(3,  1 . ,  2 . ,  3 . ) ;

Q. A list of values stored in a variable of type va_list may be passed to a function as an argument, but the variable:

Ans:- must be properly instantiated before the invocation by means of the va_start()

Q. The term "cdecl" refers to the name of:

Ans:- a way of passing arguments to a function

Q. What is the expected output of the following code?



Ans:- 2

Q. A function with the following header:  int  max ( int  n,  va_list  vals)

Ans:- needs a va_start ( vals,  n) invocation at the body's beginning

Q. The Pascal argument passing convention relies on the assumption that:

Ans:- argument are transferred through a stack ( the first argument on a list is put at the bottom or the stack)

Q. The va_arg , an identifier coming from <stdarg.h> ,is actually a:

Ans:- macro

Q. What is expected output of the following program?



Ans:-    1.000000

Q. The vaprintf() function has the following prototype:

Ans:- int  vaprintf ( char  *str,   char  *format,  va_list  ap);

Q. A header file, needed for a variadic argument list processing, is named:

Ans:-  stdarg.h

Q. What is the expected output of the following code?



Ans:- s,s,s

Q. What is expected output of the following program?


Ans:-  -3.000000

Q. A macro writing a formatted string to the  stderr  stream may be implemented as:

Ans:- #define  PRERR ( . . . )      fprintf ( atderr, _VA_ARGS_ )

Q. Only one of the following macro definitions is valid - which one?

Ans:-  #define  VARMAC ( . . . )      fprintf ( x, _VA_ARGS_ )

Q. In the atdcall argument passing convention:

Ans:- the invoker clean the stack

Q. Copying one instance of va_list to another is done by the:

Ans:- va_copy () function

Q. A variadic function is a function which:

Ans:- accepts a varying number of arguments

Q. The following trigraph is named:        . . .

Ans:-  an ellipsis

Q. The stack ( understood as an abstract data type ) is often referred to as:

Ans:- LIFO

Q. A list of values stored in a variable of type  va_list  may be passed to a function as sn argument, but the variable:

Ans:-  must be properly instantiated before the invocation means of the  va_start() function



 

No comments:

Post a Comment

Post Bottom Ad

Pages