Q: What we can’t place followed by the non-default arguments?
Solution: To avoid the ambiguity in arguments. eg. if func(int a=3, int b); so if we call func(5), here will 5 will be value of a or b, because 5 is first parameter so a should be 5 but as only one argument is given b should be 5. So to remove such ambiguity default parameters are kept at the end or rightmost side.
Q: If we start our function call with default arguments means, what will be proceeding arguments?
Solution: As a rule, the default argument must be followed by default arguments only.
Q: What is the default return type of a function?
Solution: void is the default return value of any function, to handle both empty and non-empty values.
Q: Which header file is used to pass unknown number of arguments to function?
Solution: Because the cstdarg defines this header file to process the unknown number of arguments.
Q: How can you access the arguments that are manipulated in the function?
Solution: va_list is provided by C++ to access manipulated arguments in function.
Q: What is the maximum number of arguments or parameters that can be present in one function call?
Solution: C++ allows maximum number of 256 arguments in a function call.
Q: What will initialize the list of arguments in stdarg.h header file?
Solution: va_start initialises the the list of arguments inheader file.
Q: To which does the function pointer point to?
Solution: A function pointer points to a function.
Q: What will we not do with function pointers?
Solution: As it is used to execute a block of code, So we will not allocate or deallocate memory.
Q: What is the default calling convention for a compiler in c++?
Solution: __cdecl is the default calling convention for a compiler in c++.
You Have Score    | /10 |