|
-
November 30th, 2004, 04:11 AM
#1
Usage of static const
Hi,
When are static consts to be used?
I have some constants which are being used only by that class in that file.
which is preferrable - declaring static consts in class declaration so that it can be initialised there itself / declaring consts in class declaration and initialising them in cpp / declaring consts outside the class so that its scope is that file?
is there any advantage of the above methods?
constants are by default static. Then why static const declaration is necessary?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|