-
What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
char* p;
unsigned long int test = sizeof(size_t(0) / 3);
cout << test << endl;
try
{
p = new char[size_t(0) / 3];
delete[ ] p;
}
catch (bad_alloc &BadAllocation)
{
cout << BadAllocation.what() << endl;
};
return 0;
}
-
- 8
- 4
- 2
- 1
- Depends on compiler
Correct Option: E
The size of unsigned long int always depends on compiler.