Hi,
I am trying to work out a code sample to demonstrate the debugging functionality in Visual Studio 2008 with C#. I'm trying to build a code sample which would have a 'not so obvious' mistake in it, which would result in unexpected output.
A non working example would be:
static void Main(string[] args) {
int a, b;
a = args[0];
b = args[1];
if (a = b) Console.WriteLine("They are equal!");
else if (a < b) Console.WriteLine("Number 1 is smaller!");
else Console.WriteLine("Number 1 is larger!");
}
Something like this would not be too obvious when just reading over the code, but it could easily be detected with debugging.
I'm looking for such an example which would work in Visual Studio 2008 with C#.
Thanks for the help!