What is wrong in the following code?

```
#include
using namespace std;

class TempClass
{
public:
int i;

TempClass()
{
int i = 5;
}
};

int main()
{
TempClass temp(2);
return 0;
}
```

a. The program has a compilation error because TempClass does not have a constructor with an int argument.
b. The program compiles fine, but it does not run because class C is not public.
c. The program has a compilation error because TempClass does not have a default constructor.
d. The program compiles and runs fine.


a. The program has a compilation error because TempClass does not have a constructor with an int argument.

Computer Science & Information Technology

You might also like to view...

A class facilitates making an abstract data type because:

A. a class never has more than one data type B. an abstract data type, such as a string, can be a data member of a class C. the data stored in an object of the class is an abstraction, and to manipulate the data we only need to use the functions (operations) of a class D. None of the above

Computer Science & Information Technology

This is used to identify a host (or hosts) that offers a specific type of service.

What will be an ideal response?

Computer Science & Information Technology

Some mobile digital wallet transactions use _________ technology, a wireless technology used to facilitate transmission between devices. A. RAID (redundant array of independent disks) B. optical character recognition (OCR) C. Ethernet Hardware Address (EHA) D. Near Field Communications (NFC)

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Suppose two-thirds of the data belong to the positive class and the remaining one-third belong to the negative class. What is the expected error of a classifier that predicts every test record to be positive?

Consider the task of building a classifier from random data, where the at- tribute values are generated randomly irrespective of the class labels. Assume the data set contains records from two classes, “+” and “?.” Half of the data set is used for training while the remaining half is used for testing.

Computer Science & Information Technology