Declare a variable

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
C# Code Snippets

C# Source Code Bank

See also …
edit

This C# code snippet declares variables of all the C# types without initializing them.

class VariableDeclarations
{
   public static void Main()
   {
   // Type      Identifier
      bool	aBool;
      byte	aByte;
      decimal	aDecimal;
      double	aDouble;
      char	aChar;
      float	aFloat;
      int	aInt;
      long	aLong;
      object	aObject;
      sbyte	aSbyte;
      uint	aUint;
      short	aShort;
      string	aString;
      ushort	aUshort;
      ulong	aUlong;
   }
}

Today's Deals: Electronics

Personal tools