cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Custom Operator?
Custom Operator?
Oct 22, 2008 at 10:22pm UTC
CheesyBeefy
(80)
Is it possible to create your own operators? (eg. +, -, *, /, etc. )
Thanks in advance,
CheesyBeefy
Oct 22, 2008 at 10:38pm UTC
firedraco
(6247)
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.
Last edited on
Oct 22, 2008 at 10:40pm UTC
Oct 23, 2008 at 12:13pm UTC
Bazzy
(6281)
Operator overloading is also valid for
enum
s
Topic archived. No new replies allowed.