KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm struggling to get my head around the differences between the various places you can put 'const' on a function declaration in c++. What is the difference between const at the beginning: const int MyClass::showName(string id){ ... } And const at the end like: int MyClass::showName(string id) const{ ... } Also, what is the result of having const both at the beginning and at the end like this: const int MyClass::showName(string id) const{ ... }
Tags (comma-separated)
Save Edits
Cancel