It is legal to call a constructor as a member function of an object of a class,as in
class A
{
public:
A(){}
A(int x,int y):xx(x),yy(y){}
// other members
private:
int xx;
int yy;
};
int main()
{
A w;
w.A(2,3);// Is this legal?
}
Correct Answer:
Verified
Q15: Any use of the keyword const is
Q17: You can write a class that is
Q17: Vector assignment is well behaved.
Q18: A constructor can be called implicitly or
Q19: Inline functions are always more efficent than
Q21: Which of the following are legal access
Q22: Describe the differences between a call to
Q23: A constructor
A)can only be used to initialize
B)must
Q24: Describe in terms of who needs access
Q25: Given the definitions below.Rewrite the definition of
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents