// (c) 2006 Richard Grimes // www.grimes.demon.co.uk using System; class App { static void func(int x) { uint y; try { checked { y = (uint)x + 1; } } catch(OverflowException oe) { Console.WriteLine(oe.Message); } } static void Main() { func(42); } }