View Single Post
Old 14-08-2009, 10:24   #14
Damien
Remoaner
Cable Forum Team
 
Damien's Avatar
 
Join Date: Mar 2004
Posts: 32,796
Damien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver bling
Damien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver blingDamien has a lot of silver bling
Re: Programming Challenges?

Quote:
Originally Posted by LemonyBrainAid View Post
Int32 is actually the structure that contains "int" - so you can just as easily use 'int' or actually use an implicitly typed local variable - 'var' as it will actually pick up that your variable type is an integer.
I prefer using Int32 because I prefer the highlighting in Visual Studio for it . As for var, there is little point in this case because I know the type of the variable, for the sake of clear code it is easier to explicitly declare it. Anyone reading the code will be very clear on what data type this is. (Also, Not everyone uses C# 3.5, which introduced Implicitly typed variables)

Quote:
However - your code will simply run through and then close when it's finished calculating all of the multiples, what you may want to do is stick
Code:
Console.ReadKey(true);
after your for loop - this will then only exit on keypress.
My example was writing to a String Builder which had a debug at the end. I changed it to console at the end. Probably should have added that.
Damien is offline   Reply With Quote