alarm
Ask a question
Computer Science
Calimesa

Write a program that creates a vector of user given size M using NEW operator( by creating a class)

answers: 1
Register to add an answer
Answer:

Answer:

#define null 0

#include <iostream.h>

#include <conio.h>

void main()

{

void memory(int);

clrscr();

textcolor(16);

textbackground(1235);

clrscr();

cout<<"Enter Memory M you Want to create:-";

int size;

cin>>size;

memory(size);

getch();

}

//MEMORY function

void memory(int s)

{

int *m = new int[s];

if(m!=null)

{

cout<<"\nWe are Successfull";

cout<<"\n\n\n\n\tNow You Want to Delete This Created Memory";

cout<<"\n\n\tEnter Y or y for Deleting else anything:-";

char ch;

cin>>ch;

if(ch=='y' || ch=='Y')

{

delete[]m;

cout<<"\n\n\n\tCreated Memory is Delete";

}

else

cout<<"\n\n\tOK, your Memory is Safe";

}

else

cout<<"\nWe are UN-Successfull";

}

220
Mason
For answers need to register.
278
cents
The time for answering the question is over
Contacts
mail@expertinstudy.com
Feedback
Expert in study
About us
For new users
For new experts
Terms and Conditions