a) & b) return values c) data types d) $ Answer: c Explanation: The data types are ...
View Question
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int func (int a, int b)
{
cout << a;
cout << b;
return 0;
}
int main(void)
{
int(*ptr)(char, int);
ptr = func;
func(2, 3);
ptr(2, 3);
return 0;
}
What will be the output of the following C++ code? #include <iostream> ...
View Question
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int add(int first, int second)
{
return first + second + 15;
}
int operation(int first, int second, int (*functocall)(int, int))
{
return (*functocall)(first, second);
}
int main()
{
int a;
int (*plus)(int, int) = add;
a = operation(15, 10, plus);
cout << a;
return 0;
}
What will be the output of the following C++ code? #include <iostream> ...
View QuestionWhat is the default calling convention for a compiler in c++?
a) __cdecl b) _stdcall c) __pascal d) __fastcall Answer: a Explanation: __cdecl is the default calling convention for ...
View QuestionWhat will we not do with function pointers?
a) allocation of memory b) deallocation of memory c) both allocation & deallocation of memory d) finds memory status
View QuestionTo which does the function pointer point to?
a) variable b) constants c) function d) absolute variables Answer: c Explanation: A function pointer points to a ...
View Question
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int func(int m = 10, int n)
{
int c;
c = m + n;
return c;
}
int main()
{
cout << func(5);
return 0;
}
What will be the output of the following C++ code? #include <iostream> ...
View QuestionWhat is the default return type of a function?
a) int b) void c) float d) char Answer: b Explanation: void is the ...
View QuestionIf we start our function call with default arguments means, what will be proceeding arguments?
a) user argument b) empty arguments c) default arguments d) user & empty arguments Answer: ...
View QuestionWhat we can’t place followed by the non-default arguments?
a) trailing arguments b) default arguments c) both trailing & default arguments d) leading ...
View Question