Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
C C++ cpp-operator

Scope Resolution Operator Versus this pointer in C++?

Consider below C++ program: // C++ program to show that local parameters hide // class members #include<iostream> using namespace std; class Test ...
C C++ cpp-pointer

Opaque Pointer

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 which points to a da...
C C++ School Programming

Pointers in C and C++ Set 1 (Introduction, Arithmetic and Array)

Pointers store address of variables or a memory location. // General syntax datatype *var_name; // An example pointer "ptr" that holds // address of an ...
C C++ cpp-pointer

Smart Pointers in C++

Consider the following simple C++ code with normal pointers. MyClass *ptr = new MyClass(); ptr->doSomething(); //  We must do delete(ptr) to avoid ...
C++ pointer CPP

Type of ‘this’ pointer in C++

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 the member func...
C C++ pointer

When do we pass arguments by reference or pointer?

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 funct...
C C++ School Programming

‘this’ pointer in C++

To understand ‘this’ pointer, it is important to know that how objects look at functions and data members of a class. 1. Each object gets its own copy o...
C C++ School Programming

Dangling, Void , Null and Wild Pointers

  Dangling pointer A pointer pointing to a memory location that has been deleted (or freed) is called dangling pointer. There are three different ways where Poi...
C C++ cpp-parameter-passing

Passing by pointer Vs Passing by Reference in C++

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 the following questions are inevitable;...
C C++ School Programming

Pointers vs References in C++

Prerequisite: Pointers, References C and C++ support pointers which is different from most of the other programming languages. Other languages including C++, Jav...

Subscribe to Our Newsletter