.comment-link {margin-left:.6em;}
Hey there, I'm Rowan. I'm currently studying Software Engineering at UTM, and I'm also an IT Entrepreneur. This is my programming blog - you'll find loads of C# stuff in here, as well as MySQL and C tutorials with source. Comments are most welcome.
My Other Blog(s) and Site(s)Friend sites and blogsMy Recent Posts
Tutorials
Best ArticlesMy C-Sharp IdeasArchivesBlog Directories |
Tuesday, September 26, 2006Increase Array Bounds in C#
It's been a long time since I posted anything useful on this blog. I recently looked up the list of things people were looking for before falling onto this blog.
Increase Array Bounds in C# For those of you who are new to C#, let me quickly sum this up: don't use arrays unless you're absolutely and positively certain that the array you're using will never use more than the number of values you created it for. Use an array for the number of days. Use an array of 8 bits to hold a byte. Use an array of 12 for the number of months. Those are values that we're absolutely sure will never change. If you ever need to increase the size of an array somewhere in your code - you had it wrong. Use the ArrayList from the System.Collection namespace, or List System.Collections.Generic if you're on .Net 2.0 to create and use dynamic arrays. Here's some sample code for you to have fun with:
|