Horje
true/false: the ampersand ( &) is used to dereference a pointer variable in c++. Code Example
true/false: the ampersand ( &) is used to dereference a pointer variable in c++.
//The ampersand is used to dereference a pointer variable
int a = 10
int *ptr = &a //points to the location in memory instead of the value (10)

//Additionally, the ampersand can be used to point to another variable like so:
int& b = a // points to the value of a, which is 10

//Run the following code to test
cout << a << endl;
cout << ptr << endl;
cout << b << endl;




Cpp

Related
map of vector of struct error Code Example map of vector of struct error Code Example
C++ Converting Centimeters to Meters Code Example C++ Converting Centimeters to Meters Code Example
how to interface c++ in haxe Code Example how to interface c++ in haxe Code Example
xmake run with arg Code Example xmake run with arg Code Example
qt rotate qimage Code Example qt rotate qimage Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9