Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
#include
3.
#include
4.
using namespace std;
5.
const int bsize = 512;
6.
int *pa;
7.
bool allocate = true;
8.
void get_memory()
9.
{
10.
cerr
Options:
A .  free store addr
B .  Error
C .  Segmentation fault
D .  None of the mentioned
Answer: Option C

In this program, The memory will go beyond the limit, So there will be exhaustion in memory.
Output:
$ g++ free4.cpp
$ a.out
free store addr = 0x80a8008
Segmentation fault



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers