How to overload % operator | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

How to overload % operator

How can I overload modules operator in C++, kindly explain and provide me an example. Thank You

25th Sep 2023, 9:57 AM
Harsh Maurya
Harsh Maurya - avatar
1 ответ
0
You can overload it just like +, - or any other operator in C++. there is not any difference. Second operand will be passed as argument to the overload function and you can return whatever you want after processing it
29th Sep 2023, 11:29 AM
🌀 Shail Murtaza شعیل مرتضیٰ
🌀 Shail Murtaza شعیل مرتضیٰ - avatar