Topic: const int const num; not pointer !! w
Author: clamage@Eng (Steve Clamage)
Date: 1998/01/13 Raw View
The first line is invalid without an initializer (see draft standard
section 8.5 "Initializers", paragraph 9). The const means that
attempting to change the object "number" has undefined results. It
also means that the object does not have external linkage unless
explicitly qualified with "extern". Finally, if the the intializer
for "number" is an integral constant expression, "number" can be
used in integral constant expressions -- for example, as an
array dimension.
The second line is invalid, since redundant const or volatile
specifiers are not allowed (see 7.1.5 "Type specifiers").
---
Steve Clamage, stephen.clamage@sun.com
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]