Perquisite : Arrays in C/C++ In high level languages such as Java, there are functions which prevent you from accessing array out of bound by… Read More »
This article demonstrates some of the inbuilt functions that can be used to query and manipulate array types, even a multidimensional array. These functions can… Read More »
Consider the below C++ program. Is it right way of returning array from a function? In function ‘int* fun()’: 6:8: warning: address of local variable… Read More »
The introduction of array class from C++11 has offered a better alternative for C-style arrays. The advantages of array class over C-style array are :-… Read More »
From C++11 onwards, some new and interesting algorithms are added in STL of C++. These algorithms operate on an array and are useful in saving… Read More »
What is Array Decay? The loss of type and dimensions of an array is known as decay of an array.This generally occurs when we pass… Read More »
We can find size of an array using sizeof operator as shown below. // Finds size of arr and stores in ‘size’ int size =… Read More »
Suppose we want to create a class for Graph. The class stores adjacency matrix representation of the graph. Therefore, our class structure would be something… Read More »
How to compute size of an array parameter in a function? Consider below C++ program: Output: 40 8 The above output is for a machine… Read More »
Following is a general way of printing 2D matrix such that every row is printed in separate lines. How to print print without using any… Read More »
If someone has defined an array such as “int array”, what’s the meaning of “array” or “&array”? Are they both same or are they different?… Read More »
Variable length arrays is a feature where we can allocate an auto array (on stack) of variable size. C supports variable sized arrays from C99… Read More »
We have introduced arrays in set 1 (Introduction to arrays in C).
In C, when we pass an array to a function say fun(), it is always treated as a pointer by fun(). Below example demonstrates the… Read More »
An array is collection of items stored at continuous memory locations. The idea is to declare multiple items of same type together.