Skip to content

Tag Archives: pointer

Pointers: A pointer is a variable that holds memory address of another variable. A pointer needs to be de referenced with * operator to access… Read More
Prerequisite: Pointer in C and C++, Double Pointer (Pointer to Pointer) in C A pointer is used to point to a memory location of a… Read More
NULL pointer in C At the very high level, we can think of NULL as a null pointer which is used in C for various… Read More
Pointers store address of variables or a memory location. Syntax: datatype *var_name; Example: pointer “ptr” holds address of an integer variable or holds address of… Read More
Given a matrix, the task is to construct a linked list matrix in which each node is connected to its right and down node.Example:   Input:… Read More
Given an array, write a program to find the sum of array using pointers arithmetic. In this program we make use of * operator .… Read More
In C++, we can pass parameters to a function either by pointers or by reference. In both the cases, we get the same result. So… Read More
Most of the times declarations are simple to read, but it is hard to read some declarations which involve pointer to functions. For example, consider… Read More
The qualifier const can be applied to the declaration of any variable to specify that its value will not be changed ( Which depends upon… Read More
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… Read More
In C++, variables are passed by reference due to following reasons:1) To modify local variables of the caller function: A reference (or pointer) allows called… Read More
In C/C++, arrays and pointers have similar semantics, except on type information. As an example, given a 3D array int buffer[5][7][6]; An element at location… Read More
In C++, this pointer is passed as a hidden argument to all non-static member function calls. The type of this depends upon function declaration. If… Read More
Declare “a function with argument of int* which returns pointer to an array of 4 integer pointers”. At the first glance it may look complex, we… Read More
In C++, delete operator should only be used either for the pointers pointing to the memory allocated using new operator or for a NULL pointer,… Read More