Skip to content

Tag Archives: cpp-pointer

Given two strings, compare the strings using pointers Examples: Input: str1 = geeks, str2 = geeks Output: Both are equal Input: str1 = hello, str2… Read More
The std::is_pointer template of C++ STL is used to check whether the given type is pointer or not. It returns a boolean value showing the… Read More
New programmers are usually in the search of ways to return multiple values from a function. Unfortunately, C and C++ do not allow this directly.… Read More
Prerequisite: Pointers vs References in C++. For clear understanding, let’s compare the usage of a “pointer to pointer” VS “Reference to pointer” in some cases.… Read More
Like references to simple data types, we can have references to pointers. // CPP program to demonstrate references to pointers. #include <iostream> using namespace std;… Read More
What is Segmentation Error ? – It is the runtime error caused because of the memory access violation. For Eg :-Stackoverflow, read violation etc.. We… Read More
A Cast operator is an unary operator which forces one data type to be converted into another data type. C++ supports four types of casting:… Read More
Prerequisite : Pointers in C/C++, Memory Layout of C Programs.   To pass arguments by reference. Passing by reference serves two purposes (i) To modify variable… Read More
Dereferencing an unknown memory location : C programmers mostly use scanf() function to take input, but sometimes a small mistake can bring a bug or… Read More
Given a singly linked list, delete all occurrences of a given key in it. For example, consider the following list. Input: 2 -> 2 ->… Read More
Resources are always a premium. We have strived to achieve better utilization of resources at all times; that is the premise of our progress. Related… Read More
reinterpret_cast is a type of casting operator used in C++.   It is used to convert a pointer of some data type into a pointer of… Read More
Prerequisite : Pointers in C/C++ Given an array, write a program to reverse it using pointers . In this program we make use of *… 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
Prerequisite: Pointers Assuming the size of int = 4 bytes, size of a pointer variable = 8 byte, what will be the output of following… Read More

Start Your Coding Journey Now!