Skip to content

Tag Archives: cpp-array

Following is a general way of printing 2D matrix such that every row is printed in separate lines.  C for (int i = 0; i… Read More
If someone has defined an array such as “int array[5]”, what’s the meaning of “array” or “&array”? Are they both same or are they different?… Read More
Variable length arrays are also known as runtime sized or variable sized arrays. The size of such arrays is defined at run-time.  Variably modified types… Read More
We have introduced arrays in set 1 (Introduction to arrays in C). In this post array properties in C are discussed. 1) In C, it… Read More
A whole array cannot be passed as an argument to a function in C++. You can, however, pass a pointer to an array without an… Read More
Array It is a group of variables of similar data types referred to by a single element. Its elements are stored in a contiguous memory… Read More
In C, it is possible to have array of all types except following. 1) void. 2) functions. For example, below program throws compiler error int… Read More
Question Source: Aricent Interview Although both expressions can be used to create a variable to store one character, there are following differences. 1) “char a”… Read More
This post is an extension of How to dynamically allocate a 2D array in C? A one dimensional array can be easily passed as a pointer,… Read More
  Following are different ways to create a 2D array on the heap (or dynamically allocate a 2D array).In the following examples, we have considered… Read More
  Pointers are used for storing address of dynamically allocated arrays and for arrays which are passed as arguments to functions. In other contexts, arrays… Read More
Most of the time, pointer and array accesses can be treated as acting the same, the major exceptions being:  1) the sizeof operator o sizeof(array) returns… Read More

Start Your Coding Journey Now!