A shorthand array notation in C for repeated values Last Updated : 18 Sep, 2017 Comments Improve Suggest changes Like Article Like Report In C, when there are many repeated values, we can use a shorthand array notation to define array. Below program demonstrates same. C // C program to demonstrate working of shorthand // array rotation. #include <stdio.h> int main() { // This line is same as // int array[10] = {1, 1, 1, 1, 0, 0, 2, 2, 2, 2}; int array[10] = {[0 ... 3]1, [6 ... 9]2}; for (int i = 0; i < 10; i++) printf("%d ", array[i]); return 0; } Output: 1 1 1 1 0 0 2 2 2 2 Note that middle gap of 2 is automatically filled with 0. Comment More infoAdvertise with us Next Article A shorthand array notation in C for repeated values K Kaushik Annangi Improve Article Tags : Misc C Language c-array Practice Tags : Misc Similar Reads How to store words in an array in C? We all know how to store a word or String, how to store characters in an array, etc. This article will help you understand how to store words in an array in C. To store the words, a 2-D char array is required. In this 2-D array, each row will contain a word each. Hence the rows will denote the index 2 min read Pointer vs Array in C Most of the time, pointer and array accesses can be treated as acting the same, the major exceptions being:  1. the sizeof operator sizeof(array) returns the amount of memory used by all elements in the array sizeof(pointer) only returns the amount of memory used by the pointer variable itself 2. 1 min read How to Get Value of Multidimensional Array in C? Prerequisite: Array in C An array is a type of data structure where we can store multiple elements of similar data types. A multidimensional array can be termed an array of arrays that stores homogeneous data in tabular form. Data in multidimensional arrays are stored in row-major order. Declaration 8 min read Pointers vs Array in C++ Arrays and pointers are two derived data types in C++ that have a lot in common. In some cases, we can even use pointers in place of arrays. But even though they are so closely related, they are still different entities. In this article, we will study how the arrays and pointers are different from e 3 min read Initialization of Multidimensional Array in C In C, multidimensional arrays are the arrays that contain more than one dimensions. These arrays are useful when we need to store data in a table or matrix-like structure. In this article, we will learn the different methods to initialize a multidimensional array in C. The easiest method for initial 4 min read Like