TODAY JAVA SCHOOL

In java school, programming, design, computer general knowledge, web application, software, web services, social media, digital marketing, oops, concept of programming language, oops feature, console media, graphics medium, first programming, c, c ++ , Java, PHP, SQL, MySQL, HTML, HTML_5, J_query, JavaScript, Bootstrap, Framework, images with logos, examples, shared and explained.

https://www.amazon.in/b?node=26373545031&linkCode=ll2&tag=1234567801cdb-21&linkId=3b9882431b00409b44141e0344b35a15&language=en_IN&ref_=as_li_ss_tl

Breaking

Saturday 20 June 2020

Allocating Array In C++| Allocating Array In C++ Programming Language| Allocating Array In C++ Program| Allocating Array In C++ Example| Allocating Array In C++ In Hindi

Allocating Array In C++

If we want any allocating array  for dynamic memory allocate which we needed so for this we have to use new keyword or if we want to memory allocation to delete so we needed to use  delete keyword.

image of Allocating Array In C++

Fig:Allocating Array In C++

Program:

#include<iostream.h>

#include<conio.h>

void main()

{

int *p;

p=new int[5];

cout<<”example of allocating object”;

for(int i=0,i<=4;i++)

{

cin>>p[i];

for(int j=0;j<=4;j++)

{

cout<<”p[j];

}
}

delete p;

getch();

}


Output:

Allocating array

3

4

5

6

7
34567

 

 


No comments:

Post a Comment