cplusplus.com cplusplus.com
cplusplus.com   C++ : Forums : Beginners : const questions
  Search:
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forums
Forums
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Articles
Lounge
Jobs

-

question  const questions

azrielcross (3)
When given the declaration:
bool equalTime(const clockType$ otherClock) const;

I understand the const keyword in the formal parameter list is ensuring that the parameter otherClock is not going to be changed. What I don't understand is:

a) Why the function itself has a second const declaration?
b) Does the precedence of the keyword matter? i.e.

1
2
3
const bool equalTime(...);
bool const equalTime(...);
bool equalTime(...) const;


Do these do the same thing? Or is there a rhyme and reason to the positioning?

Thank you
|
ropez (312)
Here's the same question already answered:
http://www.cplusplus.com/forum/beginner/1618/
|

This topic is archived - New replies not allowed.
Home page | Privacy policy
© cplusplus.com, 2000-2008 - All rights reserved - v2.2
Spotted an error? contact us