Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The this pointer is a hidden pointer inside every class's non-static function which points to the class's particular object through which the concerned function is called.
Example:
Code:
class A
{
private:
int rollNumber;
public:
A (int rollNum)
{
rollNumber = rollNum;
}
void setRollNumber (int rollNum)
{
rollNumber = rollNum;
}
};
In the cases where the derived classes may share the common functionality
but with altogether "different" definitions, it makes sense to force the
developers to create their own definitions for those common functions in
concerned derived classes.
This can be achieved by making the class "abstract".
A class is called an "abstract" class when it contains at least one "pure
virtual" function.
Object oriented programming is all about representing the parts of
the problem statements as `objects` and having them interact with
each other (by calling function(s) of the object in question).
Every object has a type. The type of an object is often called a
`class` in object oriented programming. The class contains the list
of characteristics of the object and the functions which the object
is capable of performing.
We can have many...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.