Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Overload operators??
Message
 
To
05/02/2002 22:33:55
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00615854
Message ID:
00615866
Views:
16
>I'm trying to learn C#, I just bought a book and am going through it. I'm also only experienced in FoxPro and although it may be 'overload operators' may pertain to FoxPro, I've personally never heard of it.
>
>So, what does overload operators mean?
>

If you create a custom type, you may want to add two variables of those types one to other. You can "overload" the "+" operator in the way it can perform the operation on your custom type.

For example, assume that the "+" operator can perform additions only on numeric types. You create a new type who consist of a number and a char (ie. 2H or 6L) and call this type numchar. If you try to add two numchar, you will have an error because the operation was unknown for this type. You can overload the "+" operator to perform additions on the numchar type.

I dont know if my explaination was clear enough, may be a real "english speaker" can jump in and help you more... :)

HTH
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform