Q175
What will be the output of the following C++ code? #include #include using namespace std; int main() try int * array1 = new int[100000000]; int * array2 = new int[100000000]; int * array3 = new int[100000000]; int * array4 = new int[100000000]; cout << "Allocated successfully"; catch(bad_alloc&) cout << "Error allocating the requested memory." << endl; return 0;
A.
Allocated successfully
B.
Error allocating the requested memory
C.
Depends on the memory of the computer
AnswerD.
Error
Answer: Option C
Solution
Answer: Option C
No explanation is given for this question Let's Discuss on Board