C Language | Array | Start your journey with C | Part 5
Arrays in C : An array is collection of items of same datatype stored in a continuous block of memory under a variable name. Array declaration in C : We can declare an array by specifying the size with a variable or by directly initializing elements of the array or by both. all type of declaring example is show below : Array declaration by specifying size : // Array declaration by specifying size int var[10]; // With recent C versions, you can also // declare an array of user specified size int x = 10; int var[n]; Array declaration by initializing elements : // Array declaration by initializing elements int var[] = { 10, 20, 30, 40 } ; // Compiler creates an array of size 4. // above is same as "int var[4] = {10, 20, 30, 40}" An Example to show that array elements are stored at contiguous locations : #include<stdio.h> void main() { // an array of 10 integers. If var[0] is stored at /...