Question about the following:
As we know by now, Sally so, "makes" an object from the class Sally called so, but why is it that just by typing so(3,87) so goes from being a object to a constructor?
*I do understand that the constructor in the class Sally is designed to take two integers
I also understand that the constructor automatically runs when an object is made, or at least when an object is a part of a function-call.
Why can we not just give write:
Sally::Sally(int a, int b) : constVar(b)....? instead of having to code the following:
Sally::Sally(int a, int b) : regVar(a), constVar(b)?
In my class, we almost allways give the private variabel the parameter 0. Why is that?
Sally::Sally(int a, int b) : regVar(0), constVar(0)