Simple sample code for C to determine data types

  • 2020-06-03 08:06:43
  • OfStack

C# simple example code for determining data types:


int   i   =   5; 
Console.WriteLine( "i is an int? {0}",i.GetType()==typeof(int)); 
Console.WriteLine( "i is an int? {0}",typeof(int).IsInstanceOfType(i)); 


Related articles: