Declare a simple struct : Struct : Struct C# Examples


C# Examples » Struct » Struct »

 

Declare a simple struct









    
struct  Fraction  {
    public  int  numerator;
    public  int  denominator;
}

public  class  MainClass  {
    public  static  void  Main(  )  {
        Fraction  f;
        f.numerator      =  5;
        f.denominator  =  10;
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Struct
» Struct