In the beginning of my journey learning C++, I thought an object is an OOP-only related term. However, the more I learn and the more I read, I can see that this not the case
The C++11 standard is pretty clear:
1.8 The C ++ object model [ intro.object ]
An object is a region of storage. [ Note: A function is not an object, regardless of whether or not it occupies storage in the way that objects do. — end note ]
That's it. An object is a chunk of memory in which data can be stored.
If you think about it OO or Object Orientation makes more sense when you realize that in the old days the programs were organized around the functions which operated upon the objects (or data).
The term "object" was around long before object orientation.
What object orientation did was change the program organization from being organized around the functions to being organized around the data itself - the objects.
Hence the term object orientated.
Change of paradigm.
Here we see the paradigm shift from the old days:
struct my_object
{
int i;
char s[20];
};
void function(my_object* o)
{
// function operates on the object (procedural / procedure oriented)
}
To what we have now:
struct my_object
{
void function()
{
// object operates on itself (Object Oriented)
}
int i;
char s[20];
};