IT Community - Software Programming, Web Development and Technical Support

Const means?

This is a discussion on Const means? within the C and C++ Programming forums, part of the Software Development category; Hi everyone, I have a question of "const". char* dump() const; What does the "const" mean? ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 10-11-2007, 06:07 AM
jeyaprakash.c jeyaprakash.c is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 228
jeyaprakash.c is on a distinguished road
Question Const means?

Hi everyone,

I have a question of "const".

char* dump() const;

What does the "const" mean?

Thanks
__________________
thanx n regards
jeyaprakash.c
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-11-2007, 10:41 PM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Smile Re: Const means?

The keyword 'const' makes the function constant. Only member function of class can be constant. Constantness of member function means that value for any variable of the program cannot be changed in this function.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-17-2007, 07:57 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Smile Re: Const means?

the word const simply means nothing but do not change it, for example if it was a function that will return maybe age it simply means it must bring age as it is.
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-24-2007, 06:30 AM
vbarta vbarta is offline
D-Web Trainee
 
Join Date: Nov 2007
Posts: 1
vbarta is on a distinguished road
Default Re: Const means?

Quote:
Originally Posted by S.Vinothkumar View Post
Constantness of member function means that value for any variable of the program cannot be changed in this function.
That isn't correct. const methods can still change global values, they just can't change fields of the object on which they're called.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/c-c-programming/4054-const-means.html
Posted By For Type Date
DiscussWeb IT Community - Technical Support and Technology Discussions This thread Refback 11-25-2007 07:45 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can we use AT commands in j2me? means how can we pass an AT command one phone to mobilegeek J2ME 1 11-10-2007 01:35 AM
What are the different ways to login to a remote server? Explain the means, advantage Sabari Server Management 0 09-12-2007 12:36 PM
What means by Java Native Interface?Benifits of its prasath Java Programming 1 07-19-2007 04:04 AM
What SPAM means in easy word? montyauto Advertising Sales and Affiliate Programs 5 03-14-2007 10:35 PM


All times are GMT -7. The time now is 06:08 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0