The term instantiation is yet to bear clear meaning to me from C++ Language perspective though it is clear to me from Natural Language perspective like its usage in philosophy -- instantiating refers to the representation of a universal or abstract concept by an actual example of daily life.
I think the natural language fits.
An object in C++ begins as an idea, an abstraction, and is implemented in code.
To use an object, you have to have one. Going from have N objects to having N + 1 objects is a matter of making a new one, a new instance of the abstract object.
Verbiating "making an instance" is done with the word "instantiate".
And let's not forget the noun instantiation either.
HTH
a7
I have the following declarations:
Rectangle rect1(4, 5); //Class Name is: Rectangle; objcet name: rect1
Rectangle rect2(10, 15);
In the above, which one is an instance of whom?
Put your thinking cap (back) on.
Here rect1 and rect2 are instantiated, they are both instances of the object define by the class whose name is Rectangle.
The syntax is like a good old integer
int myInteger = 5;
I don't think anyone says you have instantiated an object of type int with the name myInteger.
There are languages that do go to the extreme where everything is an object, C/C++ not so much as that.
HTH
a7
Here is my confusion:
Given:
Figure-1:
Is the object rect1 an instance of Rectangle (the Class Name) which is a tag for all those stuff under the class body of Fig-1?
Yes, it is.
Bravo!
A class name is an identifier. Dunno about tag, it seems to have meaning.
Perhaps if you were to label your questions as rhetorical in nature or not we would have a choice as to whether or not to engage.
a7
This is my basic understanding (Fig-1) about a Class created /declared
using class keyword.
Figure-1:
What about the constructor ? That surely deserves a special mention.
What shoud I say about the Constructor Function? Should I present the whole sketch to demonstrate the definition of the constructor function?
Those parameters are arguments, and you did not label the corresponding parameters.
a7
Thanks! Corrected.
We have these words:
instance : noun
instnatiate : verb
instantiated : past form of verb/participle
instatiating : gerund
Now, are the following sentences carry the identical/similar meanings when applied to C++ Language?
1. An object is an instance of Class Name (aka Class or classes/Classes and NOT class as class is a keyword). (noun)
2. I can instantiate an object from a Class. (verb)
3. An object can be instantiated from a Class. (partciple)
4. Instatiating refers to the process of creating an object from a Class. (gerund)
Where the Class is a mold, the Object is made from that mold.
Instantiation is the making of the Object from the Class mold.
Declaring an int does the same thing since before C++ came along with new terms.
Hello GolamMostafa
Give a simple example to the class keyword using the BWOD example.
I have been particularly interested in the validation of the four sentences of post #16 as I have to present them time-to-time to the pupil.
Shall I be allowed to use millis() function in the to be Class based codes/sketch?
You might explain the advantages and disadvantages to do so.

