1.

What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
char* p;
unsigned long int num = (size_t(0) / 3);
cout << num << endl;
try
{
p = new char[size_t(0) / 3];
delete[ ] p;
}
catch(bad_alloc &TheBadAllocation)
{
cout << TheBadAllocation.what() << endl;
};
return 0;
}

A. 5
B. 0
C. depends on compiler
D. bad_alloc
E. None of these
Answer» C. depends on compiler


Discussion

No Comment Found

Related MCQs