Properties of Array

Advantages of Array

Declaration of C Array

We can declare an array in the c language as below

data_type array_name[array_size];  

Now, let us see the example to declare the array.

int marks[5];  

Here, int is the data_type, marks are the array_name, and 5 is the array_size.

Initialization of C Array

The simplest way to initialize an array is by using the index of each element. We can initialize each element of the array by using the index. Consider the following example.

marks[0]=80;//initialization of array  
marks[1]=60;
marks[2]=70;
marks[3]=85;
marks[4]=75;

Pictorial representation of array initialization

Categorized in:

C

Tagged in:

, , , , , , , , , , , , ,

Share Article:

Leave a Reply

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock