?
Solved

Member function

Posted on 2005-02-26
2
Medium Priority
?
314 Views
Last Modified: 2010-04-01
Where and all we can use const member function
0
Comment
Question by:nice911
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Expert Comment

by:srini_vc
ID: 13409733
Const function is used when the class required the function like it doesn't modify the any member variable of the function.

like
int getDate() const;       // A read-only function

int Date::getDate() const
{
   return month;        // Doesn't modify anything
}
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 13434975
question used to pass points between multiple accounts. (nice911 --> srini_vc)
points forfeit.
question reclosed.

ee_ai_construct
CS Admin
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses
Course of the Month11 days, 22 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question