Identify the constructor like this: If the constructor for class A with two int arguments is called, respond with A(int, int).

Given the class definition,
```
class A
{
public:
A(){}
A(int x, char y):xx(x), yy(y) {}
// other members
private:
int xx;
char yy;
};
```
Tell which definition below is legal.
If legal, tell whether it is a definition of an object of class A.
If the definition is a legal and defines a class A object, tell which constructor is called for each of the following definitions.

a) A x(2, ‘A’);
b) A x;
c) A x = A(2, ‘A’);
d) A x(1);
e) A x( );

a) A x(2, ‘A’); , b) A x; , and c) A x = A(2, ‘A’);

d) is not legal. It tries to call A(int), but there is no such constructor defined. Part e) defines a function taking no arguments and returning a class A object.

Computer Science & Information Technology

You might also like to view...

The number of rows or columns in the DataTable can be computed using the ____ property.

A. Total B. Sum C. Count D. Aggregate

Computer Science & Information Technology

In a typical computer configuration, secondary storage has a much larger capacity than the volatile random access memory.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology