Cpp Programming Quiz 252 – Which of the following never requires any arguments?
[A].
Member function
[B].
Friend function
[C].
Default constructor
[D].
const function
Answer: Option C
Explanation:
No answer description available for this question.
Friend function
[C].
Default constructor
[D].
const function
Answer: Option C
Explanation:
No answer description available for this question.
Constructor is called either implicitly or explicitly, whereas destructor is always called implicitly.
[C].
Destructor is always called explicitly.
[D].
Constructor and destructor functions are not called at all as they are always inline.
Answer: Option B
Explanation:
No answer description available for this question.
Answer: Option C
The program will print the output Garbage-value.
[C].
The program will report compile time error.
[D].
The program will report runtime error.
Answer: Option C
Explanation:
No answer description available for this question.
Answer: Option B
#include
enum bix
{
a=1, b, c
};
int main()
{
int x = c;
int &y = x;
int &z = x;
y = b;
cout<< z--;
return 0;
}
[A].It will result in a compile time error.
[B].The program will print the output 1.
[C].The program will print the output 2.
[D].The program will print the output 3.
Answer: Option C
[B].
Answer: Option B
Explanation:
Both mean two different things. arr gives the address of the first int, whereas the &arr gives the address of array of ints.