Create custom operators

Hello everyone,

Is it possible to create our custom operators?? For example x! (factorial) where x is of int class ?

Thanks.
You can't create new operators that work on normal types (int bool etc), but you can overload the existing +, - etc operators.

http://www.cplusplus.com/doc/tutorial/classes2.html

You can create new operators for your custom classes however.

Also check this link: http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/cplr318.htm
Last edited on
No.

(Sorry)

[edit] too slow...[/edit]
Last edited on
thanks orejano i've seen the 1st link before, but i just looked at the second and im not familiar with the syntax so i doubt i can fully understand the code (more like get 50% of it).
Anyway thank u both...
Topic archived. No new replies allowed.