0
class and object definition
https://www.sololearn.com/compiler-playground/c5fpjj03M34O in this code question i wanted to keep it by just horsepower( withoout this horsepowers = x declaration) but when i do that it just returns 0. why i have to declare horsepowers as x ?? Why i can't just use only horsepowers
3 Respostas
+ 2
What did you mean without `horsepowers = x;`
That line copies value of argument <x> into private member <horsepowers>. No way to set car engine's horse power attribute without it
Tell me if I misunderstood you ...
0
Lalala The link isn't working. Pls try like this: tap "+" button, then "Code", and select your code.