Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
#include
3.
using namespace std;
4.
int main ()
5.
{
6.
try
7.
{
8.
int* myarray= new int[1000];
9.
cout
Options:
A .  Allocated
B .  Standard exception:
C .  bad_alloc
D .  Depends on memory
Answer: Option D

Variable will be allocated depends on the available space in the memory, If there is no space 

means, It will throw an exception.
Output:
$ g++ std1.cpp
$ a.out
Allocated



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers