I'll try to find something on the Internet. But as a starter, you've had a look at C (or C++? - I don't know C+). In coventional programming you have data and functions as separate entities, e.g in C you could declare some variables to hold the data:
int I;
char ch;
You also have functions to do the work, e.g. In C,
void DoThis(){
/* Insert whatever code is needed */
}
Hopefully that is familiar to you.
In Object Orientated programming, the data and the functions (often called methods) are contained in one single object. It's probably easier to use an example... I'll try a simple TV, all it does is change. Channel and display the current channel. I will (in some generic way) define a class for TV. It will have an int variable to track the channel and 2 functions one to change channel and one to report the channel.
class TV (
//the variable
int Channel;
//change channel function
void ChangeChannel(int NewChannel)
{
Channel = NewChannel;
//and whatever else may be needed for a real tv
}
//display channel function
void DisplayChannel()
{
//whatever code needed to display the variable "channel"
}
}
OK so now we have our TV class. Now its time to use it in a program to "make" a TV, change to channel 9 and display the current channel. The first thing I need to do is create a TV object. Which I will do just as I would a variable:
TV MyTV;
OK now we have the TV. I want to use MyTV. In this case we will assume that a method is called by using a period and then the method. So to change channel to channel 9 on myTV:
MyTV.ChangeChannel(9);
Or to show the current channel,
MyTV.DisplayChannel();
That's the best attempt I can make at trying to show where OOP starts to come in. I'm sure others can do better and I hope that doesn't confuse to much.
Jon