I’m declaring an instance of a class like so:
Matrix m;
This appears to implicitly initialize m (i.e. run the constructor). Is this actually the case?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, the default constructor is called.
If there is no default constructor, this statement is ill-formed. If there are no user-declared constructors, the compiler provides a default constructor.