how to use Const

Hi have just wrote a simple C++ project, Which includes a baseclass and two subclasses, Im new to C++ so finding it a bit confusing using subclassing and polymorphism compared to how simple it is in Java.

Basically I'd like to know how to declare and create methods which are both const and virtual in the base class and how to avoid errors when trying to use pure polymorphism in the childclasses, i.e. do i also have to declare the methods in the child classes virtual and const if i wish to redefine there functionality.

Also how to declare and assign a value to a const member variable....

Many thanks
Try this site:
http://www.learncpp.com/

Chapter 8.10 and Chapter 12.2 - would be the ones to anwser these
questions.
wow what a great tutorial.... bookmarked!!! thanks
Topic archived. No new replies allowed.