Here b is of the type double &, that is a double reference. It's very similar to a pointer accept it doesn't need to be dereferenced.
1 2 3 4 5 6 7 8 9 10 11 12 13
//same example with pointers
int main ()
{
double a = 3.1415927;
double *b = &a; // b is the address of a
*b = 89; //dereference b and store 89
cout << "a contains: " << a << endl; // Displays 89.
return 0;
}
Thank you for your replies. I think I understand what's happening. It's confusing that the syntax means one thing in the body of code, and another thing when used in a variable declaration.