Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Arrays Backtracking Hash

Given an array A[] and a number x, check for pair in A[] with sum as x

Write a program that, given an array A[] of n numbers and another number x, determines whether or not there exist two elements in S whose sum is exactly x. ...
Arrays Heap Sorting

Sort a nearly sorted (or K sorted) array

Given an array of n elements, where each element is at most k away from its target position, devise an algorithm that sorts in O(n log k) time. For example, let us ...
Articles C C++

Do not use sizeof for array parameters

Consider the below program. #include<stdio.h> void fun(int arr[])   {   int i;         /* s...
C C Array and String C

Initialization of variables sized arrays in C

The C99 standard allows variable sized arrays (see this). But, unlike the normal arrays, variable sized arrays cannot be initialized. For example, the following pro...
C C Array and String C

What is the difference between single quoted and double quoted declaration of char array?

In C/C++, when a character array is initialized with a double quoted string and array size is not specified, compiler automatically allocates one extra space for stri...
C C++ C Array and String

Initialization of a multidimensional arrays in C/C++

In C/C++, initialization of a multidimensional arrays can have left most dimension as optional. Except the left most dimension, all other dimensions must be specifie...
C C Array and String C Basics

Arrays in C Language Set 2 (Properties)

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 is possible to have array of all types...
C C Array and String pointer

Are array members deeply copied?

In C/C++, we can assign a struct (or class in C++ only) variable to another variable of same type. When we assign a struct variable to another, all members of the va...
C C Array and String cpp-array

Difference between pointer and array in C?

Pointers are used for storing address of dynamically allocated arrays and for arrays which are passed as arguments to functions. In other contexts, arrays and pointe...
C C Array and String cpp-array

What are the data types for which it is not possible to create an array?

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 main() { void arr[10...

Subscribe to Our Newsletter