Why we r passing argument in second but not in first one ? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Why we r passing argument in second but not in first one ?

I have been tryin to overload pre n post increment operator....when i overloaded first fun ..it didn't show any sort of error while overloading second fn....i was asked to pass an argument... Why it needed a argument? https://code.sololearn.com/cS6ejOnCiV7u/?ref=app

7th Feb 2022, 2:36 AM
Brat__
Brat__ - avatar
5 Respostas
+ 1
I would say simply to distinguish those two. Both operators show the same signature, which is not valid to have. The additional dummy parameter is simply to create a different signature to distinguish pre from post-increment.
7th Feb 2022, 5:24 AM
Ani Jona šŸ•Š
Ani Jona šŸ•Š - avatar
+ 1
Ani Jona šŸ•Š tysm brošŸ„ŗ
7th Feb 2022, 2:43 PM
Brat__
Brat__ - avatar
0
what output do you want to get ??
7th Feb 2022, 4:17 AM
Davinder Kumar
Davinder Kumar - avatar
0
imabhiiiiiišŸ„± i m getting desired output ....i just needed a proper explanation āœŒļøšŸ˜‚
7th Feb 2022, 2:42 PM
Brat__
Brat__ - avatar
0
Hlw
8th Feb 2022, 4:10 PM
Chinmoy chakraborty Antu
Chinmoy chakraborty Antu - avatar