01.Blogs :
RobMiles  
Programming, gadgets and life as a lecturer in a UK university.

How to lose over 100 million pounds

I've just managed to lose over 100 million pounds. Oh yes. That will teach me to keep my mouth shut in lectures. I bet the entire first year programming course a million pounds each that a C# program I had written would not work.

It did. Curse you C# compiler, you are too clever for me. If you are interested the problem was whether or not this would work:

Console.WriteLine ( 45.ToString() + 1 );

I reckoned that it would not, because the compiler would refuse to apply the + operator between a string (which is what 45.ToString() returns) and an int (which is what 1 is). Unfortunately the compiler just goes "Aha, I need a string here, I'll convert 1 into a string by calling ToString on it". So the program works fine and prints:

451

..and costs me millions.

But than again, we didn't shake on it, which means it doesn't count. So sue me.

Good lecture though (at least I enjoyed it).

posted on Tuesday, January 17, 2006 10:15 PM by RobMiles

# re: How to lose over 100 million pounds @ Wednesday, January 18, 2006 4:03 AM

You'll just have to buy us a beer at some point instead. :-)

Carriebeth


 
03.UPDATE CALENDAR :
<January 2006>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
2930311234

05.MY LINKS :

07.Subscriptions :

Subscriptions


© Copyright 2005 Microsoft Corporation. All Rights Reserved.
Terms of Use | Privacy Statement | Code of Conduct | Hosted by MaximumASP for Microsoft
WHO-BAR