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.
Identify the constructor like this: If the constructor for class A with two int arguments
is called, respond with A(int, int).
a)```
A x(2, ‘A’);
```
b)```
A x;
```
c)```
A x(1);
```
e)```
A x( );
```
Part a) is legal, A(int,char) is called. Part b) is legal, the default constructor,
A( ) is called. This is sometime (in truth, infrequently) written A(void). Part c) is
legal, A(int, char) is called.
Explanation:
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.
You might also like to view...
?Smaller lot sizes from vendors will help reduce the purchasing complexities for the consumer.
Answer the following statement true (T) or false (F)
When Access runs a query, it puts the results in a(n) ________ order based on how the table is defined
Fill in the blank(s) with correct word
In a one-to-many relationship one record in either table can relate to ________ record(s) in the other table
Fill in the blank(s) with correct word
If a style has both a paragraph and a character symbol next to it in the Styles pane, it is ________
A) a linked style B) the default style C) part of the Normal template D) a crossover style