Skip to content

Tag Archives: pointer

Dangling pointer: A pointer pointing to a memory location that has been deleted (or freed) is called a dangling pointer. There are three different ways… Read More
In this article, we will discuss the differences between constant pointer, pointers to constant & constant pointers to constants. Pointers are the variables that hold… Read More
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 CA pointer is used to point to a memory location of a variable.… 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 the address of variables or a memory location. Syntax: datatype *var_name; Example: pointer “ptr” holds the address of an integer variable or holds… 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: … 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 cases, we get the same result. So, what… 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 refers to the current object of the class and passes it as a parameter to another method. ‘this pointer‘ is passed… Read More