Home / CSE MCQs / C++ - MCQs :: Functions - C++

CSE MCQs :: C++ - MCQs

  1. To which does the function pointer point to?
  2. A.
    variable
    B.
    constants
    C.
    function
    D.
    absolute variables

  3. What we will not do with function pointers?
  4. A.
    allocation of memory
    B.
    de-allocation of memory
    C.
    both a & b
    D.
    none of the mentioned

  5. What is the default calling convention for a compiler in c++?
  6. A.
    __cdecl
    B.
    __stdcall
    C.
    __pascal
    D.
    __fastcall

  7. What are the mandatory part to present in function pointers?
  8. A.
    &
    B.
    retrun values
    C.
    data types
    D.
    none of the mentioned

  9. which of the following can be passed in function pointers?
  10. A.
    variables
    B.
    data types
    C.
    functions
    D.
    none of the mentioned

  11. What is meaning of following declaration? int(*ptr[5])();
  12. A.
    ptr is pointer to function.
    B.
    ptr is array of pointer to function.
    C.
    ptr is pointer to such function which return type is array.
    D.
    ptr is pointer to array of function.

  13. If the user didn't supply the user value means, then what value will it take?
  14. A.
    default value
    B.
    rise an error
    C.
    both a & b
    D.
    none of the mentioned

  15. Where does the default parameter can be placed by the user?
  16. A.
    leftmost
    B.
    rightmost
    C.
    both a & b
    D.
    none of the mentioned

  17. Which value will it take when both user and default values are given?
  18. A.
    user value
    B.
    default value
    C.
    custom value
    D.
    none of the mentioned

  19. What we can't place followed by the non-default arguments?
  20. A.
    trailing arguments
    B.
    default arguments
    C.
    both a & b
    D.
    none of the mentioned