| <<< The C programming language | Index | Pointer is a data type >>> |
#include <iostream>
using namespace std;
int main()
{
double price = 1.52;
// using address-of operator to obtain address
// of the price variable in memory:
double * location = &price;
// The following two lines do the same thing:
// access memory at a given location
cout << location[ 0 ] << "\n"; // using [subscript] notation
cout << *location << "\n"; // dereference operator *
return 0;
}
| <<< The C programming language | Index | Pointer is a data type >>> |