1.

What is the output of this program?
#include <iostream&f=gt;
using namespace std;
class Num
{
private:
int Values[15];
public:
int& operator[] (const int Val);
};
int& Num::operator[](const int Val)
{
return Values[Val];
}
int main()
{
Num Object;
Object[10] = 6;
cout << Object[10];
return 0;
}

A. 15
B. 10
C. 6
D. Compilation Error
E. None of these
Answer» D. Compilation Error


Discussion

No Comment Found

Related MCQs