C++ objects

Question:
How can I declare a constant object that is actually constant?

Answer:
Here’s an example:

const Date d; //create a const Date object 

Note that you can only invoke the const member functions of a const object.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: