Skip to content

Tag Archives: cpp-pointer

Prerequisite: Pointers There is a lot of confusion when char, const, *, p are all used in different permutations and meanings change according to which is… Read More
Prerequisite: Pointers Introduction   Pointer to Array Consider the following program:  C++ #include <iostream> using namespace std;   int main() { int arr[5] = { 1,… Read More
Dynamic memory allocation in C/C++ refers to performing memory allocation manually by a programmer. Dynamically allocated memory is allocated on Heap and non-static and local… Read More
Prerequisite : Pointers in C and C++ We already know that a pointer points to a location in memory and thus used to store the… Read More
  Pointers store address of variables or a memory location.   // General syntax datatype *var_name; // An example pointer "ptr" that holds // address of… Read More
Prerequisite – Smart Pointers C++ libraries provide implementations of smart pointers in following types: auto_ptr unique_ptr shared_ptr weak_ptr They all are declared in a memory… Read More
  Dangling pointer A pointer pointing to a memory location that has been deleted (or freed) is called dangling pointer. There are three different ways… 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 the… Read More
What is an opaque pointer? Opaque as the name suggests is something we can’t see through. e.g. wood is opaque. Opaque pointer is a pointer… Read More
Please note that the title is Functors (Not Functions)!! Consider a function that takes only one argument. However, while calling this function we have a… Read More
Consider the following C++ program that shows problem with NULL (need of nullptr)  CPP // C++ program to demonstrate problem with NULL #include <bits/stdc++.h> using… Read More
A dynamic array is an array that can grow, resize itself, contains a dynamic table, which is mutable in nature, or an array list is… Read More
How to compute the size of an array parameter in a function?Consider below C++ program:  CPP // A C++ program to show that it is… Read More
Scope resolution operator is for accessing static or class members and this pointer is for accessing object members when there is a local variable with… 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

Start Your Coding Journey Now!