Given the class below, tell to what value the default constructor initializes the data member. Name this initialization technique and give another way to write the constructor.

```
class A
{
public:
A();
private:
int a;
};

A::A() : a(17)
{
//deliberately empty
}
```


This is a base (or member) initializer list, albeit a short one. The alternate way to initialize in this constructor follows.
```
A::A()
{
a = 17;
}
```

Computer Science & Information Technology

You might also like to view...

Prove that vector 1 (vector with all entries as 1) is an eigenvector of the adjacency matrix corresponding to eigenvalue k if and only if the graph is a k-regular graph.

What will be an ideal response?

Computer Science & Information Technology

Running ________ helps improve the efficiency of a computer by regrouping related pieces of files together

Fill in the blank(s) with correct word

Computer Science & Information Technology

Dark outlines around label boxes indicate that the box is ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

Explain why this protocol prevents a global deadlock among transactions.

The kill-wait concurrency control of Exercise 20.32 is based on locking. When it is used in a distributed system, it is referred to as the wound-wait protocol. We assume that a distributed transaction uses RPC to communicate among cohorts so that when the two-phase commit protocol starts, all cohorts have completed. The kill primitive is replaced by a wound primitive. If the cohort of transaction, T1, at some site makes a request that conflicts with an operation of the cohort of an active transaction, T2, at that site, then if TS(T1) < TS(T2) then wound T2 else make T1 wait where wound T2 means that T2 is aborted (as in the kill-wait protocol), unless T2 has entered the two-phase commit protocol, in which case T1 waits until T2 completes the protocol. What will be an ideal response?

Computer Science & Information Technology