0
please anwer this question in commenta in the code
its about c++ class https://code.sololearn.com/cgx1NxioPXtq/?ref=app
2 Answers
+ 4
On line 11 you have created the Constructor of a class.
Constructors are called automatically when an object/instance of a class is created.
The code inside Constructors execute only once. They are used for various purposes like to initialize the variables of a class.
Note:
If you haven't created the Constructor of a class, the default constructor(empty) will be created and called when object of a class is created.
And to answer your second question visit this link :
https://stackoverflow.com/questions/15680190/what-is-the-diff%C3%A9rence-between-include-iostream-h-and-include-iostream
0
thank you