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

Tuesday 16 June 2020

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

Array In C++ Language

 Array  is a collection of variable belonging to the same data type. you may store group of data same data type in array.

Array might be belonging to array of the data types.

Array size must be constant value.

Array starting form 0 size.

Always, Contiguous (adjacent) memory location are used to store array elements in memory.

It is a best practice to initialize an array to zero or null while declaring, if we don’t assign any value of array.

 

image of array in c++

Fig: Array In C++

Example:

int  a[10];

How  to declare an array?

datatype  arrayname[size];


Example:

float   mark[5];

Access array element

We caqn access elelment of an array by indices.

We declare an array is mark,then first element is mark[0],and second is mark[1] and so on.

 

How to initialize an array?

It is possible to initialize an array during declaration


Example:

int  mark[5]={10,11,12,13,14};

Now we can initialize like this also

int  mark[ ]={10,11,12,13,14};

Here we specified the size so compiler know its size is 5 as  we are initializing it with 5 elements.

 

 

 


No comments:

Post a Comment