Tag: reference
Differences between a pointer and reference
Differences Between Pointer and Reference in C++ are as follows, 1.) Reference is a kind of const pointer that de-reference itself automatically. Yes, its similar to const pointer therefore once you have attached a reference to a variable or object then you cannot make it to point to someone else. Advertisements Now if you try to …
What is rvalue reference in C++11
In this article we will discuss what is rvalue reference and how it is different from lvalue reference. lvalue references Prior to C++11 we only had references i.e. A Reference variable is an alias that always points to a an existing variable i.e. Advertisements int x = 7; int & refX = x; // refX …
Pass an Array by reference to function in C++
This tutorial will discuss about a unique way to pass an array by reference to function in C++. Many times, we encounter a situation, where we need to pass a fixed size array to a function. For that we need to pass two data points in the function, The data type of elements in array. …