Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Overload operators??
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00615854
Message ID:
00615877
Vues:
22
>>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.

James,

Think about FoxPro. You can add either numbers or strings with the + operator.

"a" + "b" && result "ab"
1 + 2 && result 3

Think about what FoxPro has to do. It has to first translate the + operator into an add method. Then it has to figure out what data types it is adding (string or number) and call the correct method according to the data types. This is operator overloading.

-Dave
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform