+ 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 ответов
+ 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