Interview Question: Object Type

Sample Question #297 (programming – C++)
 
What’s a const object? When do you use it?
Advertisements
This entry was posted in Sample Qs. Bookmark the permalink.

One Response to Interview Question: Object Type

  1. Brett says:

    ANSWER
     
    Like a const variable of a built-in type, a const object cannot be modified once it’s defined (at declaration). It’s used to safeguard certain data pertinent to the class. BTW, temporary objects created by the compiler are const objects: the rest of the program cannot modify such objects.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s