Constructor initialiser list | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Constructor initialiser list

For a class ''P'', with one constant member named ''weight'' of type ''double'', fill in the blanks to initialize ''weight'' in the constructor initializer list. P::P(double w) (w) { }

24th Oct 2018, 7:18 AM
Rohan Agrawal
Rohan Agrawal - avatar
5 Answers
+ 2
P::P(double w) : weight (w) { }
26th Apr 2020, 9:46 AM
Farshid Rahimi
Farshid Rahimi - avatar
+ 1
Is there anything you're having trouble with in the assignment you posted so we can help you out?
24th Oct 2018, 11:54 AM
HoĆ ng Nguyį»…n Văn
HoĆ ng Nguyį»…n Văn - avatar
+ 1
P::P(double w) : weight (w) { }
23rd Apr 2019, 9:38 AM
Farshid Rahimi
Farshid Rahimi - avatar
+ 1
P::P(double w) : weight (w) { }
26th Apr 2020, 9:38 AM
V.SATHYA
V.SATHYA - avatar
+ 1
P::P(double w) : weight (w) { }
1st Jul 2022, 6:10 PM
Habib Sadewo Ahmad
Habib Sadewo Ahmad - avatar