Declaration of a struct and use it : Struct definition : Struct C# Examples


C# Examples » Struct » Struct definition »

 

Declaration of a struct and use it









    
using  System;

public  struct  MyStruct
{
    public  int  MyInt;
    public  long  MyLong;
    public  string  MyString;
}

class  MainClass
{
    static  void  Main(string[]  args)
    {
        MyStruct  TheStruct;

        TheStruct.MyInt  =  0;
        TheStruct.MyLong  =  0;
        TheStruct.MyString  =  "Hello  World";
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Struct
» Struct definition