As previously pointed out:
this is a pointer, and thus you have to dereference it with -> or (*) before using
it in the manner in which you're trying to do. Also, it's best to have private member variables
(m_) for classes with accessors and mutators so that you can maintain strict controls on who is
able to modify them. It might not be an issue for a simple test application, but it's good practice
to learn for coding larger projects with several people
Also, if you're looking for bad usages of this, some people feel that usage of this in the constructor is bad practice, as you're referencing an object that isn't fully formed.





Reply With Quote
Bookmarks