Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Overload operators??
Message
 
À
05/02/2002 22:33:55
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00615854
Message ID:
00615866
Vues:
17
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform