Mega Code Archive

 
Categories / C# Tutorial / Data Type
 

Cast byte back for byte calculation

using System;      class Example {        public static void Main() {          byte b;            b = 10;       b = (byte) (b * b); // cast needed!        Console.WriteLine("b: "+ b);     }      } b: 100