Cpp Programming 66 – Which of the following functions are performed by a constructor?
[B]. Construct a new object[C]. Construct a new function
[D]. Initialize objects
Answer: Option D
Answer: Option D
Answer: Option B
#include
#include
class BixString
{
char x[50];
char y[50];
char z[50];
public:
BixString()
{ }
BixString(char* xx)
{
strcpy(x, xx);
strcpy(y, xx);
}
BixString(char *xx, char *yy = " C++", char *zz = " Programming!")
{
strcpy(z, xx);
strcat(z, yy);
strcat(z, zz);
}
void Display(void)
{
cout<< z << endl;
}
};
int main()
{
BixString objStr("Learn", " Java");
objStr.Display();
return 0;
}
[A].Java Programming!
[B].C++ Programming!
[C].Learn C++ Programming!
[D].Learn Java Programming!
Answer: Option D
Answer: Option D
Answer: Option B
only pass-by-reference
[D].
only pass by address
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.