There are two forms of conversion operators, implicit and explicit : Conversion Operator Overload : Operator Overload C# Examples


C# Examples » Operator Overload » Conversion Operator Overload »

 

There are two forms of conversion operators, implicit and explicit





The general form for each is shown here:




    
public  static  operator  implicit  target-type(source-type  v)  {  
        return  value;  
}
    
   
  
   





    
public  static  operator  explicit  target-type(source-type  v)  {  
        return  value;  
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Operator Overload
» Conversion Operator Overload