2

I came across in a popular C++ blog the following code:

double const x = 1.0;

I know that const double* and double* const differ in a way that in the former the value is const while in the other the pointer is const. But what is the difference between double const and const double?

Andrew Legacci
  • 1,019
  • 2
  • 9
  • 8

1 Answers1

8

double const x = 1.0 is identical to const double x = 1.0

Both are declaring a constant double-precision floating point variable.

Zac Howland
  • 15,777
  • 1
  • 26
  • 42