Get up to 80 % extra points for free! More info:

Discussion: Lesson 3 - A RollingDie in C++ and Constructors

Back

 

Comments
Avatar
Lucian Caraba
Member
Avatar
Lucian Caraba:4/28/2020 18:51

As a rule, a more specific constructor (with fewer parameters) calls the more general one (the one with more parameters).
This sentence is wrong,right?
The specific constructor is the one with more parameters.

Edited 4/28/2020 18:53
 
Reply
4/28/2020 18:51
Avatar
Replies to Lucian Caraba
David Capka Hartinger:5/1/2020 11:49

Hi Lucian, this text is correct and refers to this piece of code:

RollingDie::RollingDie() : RollingDie(6)

The general constructor with more params RollingDie(6) is called by the specific constructor RollingDie(). In this case, it might be confusing that the specific constructor has less parameters than the general one but it can happen. If you follow the course, there are many other samples of constructor calls.

Reply
5/1/2020 11:49
You can walk through a storm and feel the wind but you know you are not the wind.
Avatar
Lucian Caraba
Member
Avatar
Lucian Caraba:5/3/2020 18:12

Thanks for your reply David!
I'll give it more looks to understand better!

 
Reply
5/3/2020 18:12
To maintain the quality of discussion, we only allow registered members to comment. Sign in. If you're new, Sign up, it's free.

3 messages from 3 displayed.