i’m not sure if what im talking about is an operator overloading question.
is it possible to overload keywords in C++??
for example : i need to write loopOver(i=0; ;i++) instead of for(i=0;;i++) ?? is that possible in C++
and i need to have something like 2 addTo 2 instead of 2 + 2
please help
thanks in advance
You can’t do that with operator overloading (you can’t change the names of the operators, only how they work).
However, evil as it is, if you don’t want to change the way they work (just the names), you would be able to achieve things like this using macros:
(Use macros with extreme care though – if used incorrectly they can cause hideous problems)