<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>CodeCall Programming Forum - Blogs - TcM</title>
		<link>http://forum.codecall.net/blogs/tcm/</link>
		<description>CodeCall is where developers can come to share programming ideas, articles, questions, answers, tips, tricks, source code, and other topics related to programming languages such as C++, Visual C++, C#, Visual Basic, ASP, ASP.NET, Java, and more.</description>
		<language>en</language>
		<lastBuildDate>Mon, 13 Feb 2012 14:38:22 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://forum.codecall.net/images/misc/rss.jpg</url>
			<title>CodeCall Programming Forum - Blogs - TcM</title>
			<link>http://forum.codecall.net/blogs/tcm/</link>
		</image>
		<item>
			<title>Stored Procedures Will Save You Time</title>
			<link>http://forum.codecall.net/blogs/tcm/262-stored-procedures-will-save-you-time.html</link>
			<pubDate>Sun, 22 Mar 2009 16:16:33 GMT</pubDate>
			<description>*Stored Procedures Will Save You Time* 
Well, just to let you guys know, I have more experience in MS SQL than MySQL… so maybe some stuff that I’m going to mention here might not be the same in MySQL… so don’t blame me. 
And you might ask, why do you use an MS product? Simple. School… so again...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore"><b>Stored Procedures Will Save You Time</b><br />
Well, just to let you guys know, I have more experience in MS SQL than MySQL… so maybe some stuff that I’m going to mention here might not be the same in MySQL… so don’t blame me.<br />
And you might ask, why do you use an MS product? Simple. School… so again don’t blame me.<br />
Anyways right now I’m very busy with creating / designing a very advanced software that uses databases for my Final Software Project, which will pretty much determine my future as a programmer, but I found sometime to share this with you in my blog. I’m only going to discuss the theory side of stored procedures, I’m not going to make this blog a tutorial on how to create them etc, I think there are many tutorials out there that can show you how to do this way better than me.<br />
<br />
<b>What are stored procedures?</b><br />
Well, if you are reading this blog most probably you do have some knowledge of programming, so pretty much a stored procedure is just like a method, it is a chunk of code that instead of copy/pasting it every time, you just make that chunk of code into a method and when you need it you just call that method. And just like a method, stored procedures, accept parameters and these parameters can be used within the chunk of code, because most probably the stored procedure will execute the same code, but the result will not always be the same, because sometimes you might need to search for client id 1 and maybe another time you will need to search for client id 2, the coding is the same but not the result.<br />
<br />
<b>Why use them?</b><br />
Well, mostly (personally) I downloaded and tried tons of software / scripts but none of them used these, mostly they had the SQL statement in a method and they call the method, instead of the stored procedure. Well, that is a good idea, but personally, I don’t find that coding very clean. It’s better to have all those repetitive SQL statements stored as procedures on the SQL server and then you call it neatly from the program by just calling the stored procedure and forwarding the parameters… which pretty much will not require and SQL statements in the software.<br />
Personally I tried both, I used SQL in the programming and used stored procedures, I must say that you will find it a lot easier and less confusing when using stored procedures. It will take you less time to develop applications that way and you will have fewer errors. And I’m not sure if it increases security too , since you will not have any SQL statements in the software itself, but I can’t really say that… but maybe someone can tell us in a comment.<br />
<br />
<b>Why this blog post?</b><br />
Well, I thought I’d share this, although most probably you will prefer to use SQL within the software, and most people (beginners* like me) would not even know that these stored procedures exist… and that they can save them a lot of time and effort and less bugs. So basically I just wanted to get this information out for these people… because beginners* like me can save a lot of time and use that extra time to do some other activities.<br />
*beginners = does not mean they are new to programming, just that they are new to databases.</blockquote>

]]></content:encoded>
			<dc:creator>TcM</dc:creator>
			<guid isPermaLink="true">http://forum.codecall.net/blogs/tcm/262-stored-procedures-will-save-you-time.html</guid>
		</item>
		<item>
			<title>Getting the command line arguments in a GUI Program using C#</title>
			<link>http://forum.codecall.net/blogs/tcm/237-getting-command-line-arguments-gui-program-using-c.html</link>
			<pubDate>Sat, 14 Feb 2009 17:01:02 GMT</pubDate>
			<description>*Getting the command line arguments in a GUI Program using C#* 
In this short tutorial I will explain to you how you can get arguments in a GUI application using C#. So let’s say that you have a program that you want that during start up it stays in the background and when the user opens it, it...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore"><b>Getting the command line arguments in a GUI Program using C#</b><br />
In this short tutorial I will explain to you how you can get arguments in a GUI application using C#. So let’s say that you have a program that you want that during start up it stays in the background and when the user opens it, it will display the normal GUI. It’s very simple; we will only need to make a few changes to the program. <br />
So, open up Program.cs (find it from the Solution Explorer) you will see something like<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:48px;">[STAThread]
static void Main()</pre>
</div>Change that to <br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:48px;">[STAThread]
static void Main(string[] args)</pre>
</div>The string[] args will get the parameters and store them into a string array, so if you will make something like <br />
<div class="bbcode_container">
	<div class="bbcode_quote">
		<div class="quote_container">
			<div class="bbcode_quote_container"></div>
			
				myexe.exe first second third
			
		</div>
	</div>
</div>You will have 3 parameters (because they are separated with a space), meaning your string array will have three parameters.<br />
Now all you have to do is make a form constructor that will accept a string array, by making something like<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:60px;"> public Form1(string[] commands) : this()
        {
        }</pre>
</div>Replace Form1 with your main form name and it will accept the array, don’t forget to make the : this() part because if you don’t it won’t execute the default constructor.<br />
Go back to the program.cs and find something like Application.Run(new Form1()); and replace that with the following code<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:72px;">if(args.Length != 0)
            Application.Run(new Form1(args));
            else
            Application.Run(new Form1());</pre>
</div>So if you will execute with no arguments it will load the default constructor and will load as normal, but if you will have some arguments it will load the other constructor and forward to the new form. Now go back to the new constructor and just make some code to do whatever you need to do, you can read the first argument and if that has a string that says ‘background’ it will run with the form as hidden (so it will run in the background). All you need to do is just loop through the array, make a couple of if statements and you are done :)<br />
In a console application you will already have the main that accepts the arguments, all you will have to do is just loop through them or whatever.<br />
Hope this was helpful.</blockquote>

]]></content:encoded>
			<dc:creator>TcM</dc:creator>
			<guid isPermaLink="true">http://forum.codecall.net/blogs/tcm/237-getting-command-line-arguments-gui-program-using-c.html</guid>
		</item>
		<item>
			<title>Comparison between Data Collections (Arrays etc…)</title>
			<link>http://forum.codecall.net/blogs/tcm/227-comparison-between-data-collections-arrays-etc.html</link>
			<pubDate>Mon, 09 Feb 2009 16:57:45 GMT</pubDate>
			<description>*Comparison between Data Collections (Arrays etc…)* 
In this blog I’m going to explain some data collections such as arrays etc… and I’m going to tell you how to declare them in C# and Java, a typical scenario on when they can be used, and I’m going to explain some characteristics of these...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore"><b>Comparison between Data Collections (Arrays etc…)</b><br />
In this blog I’m going to explain some data collections such as arrays etc… and I’m going to tell you how to declare them in C# and Java, a typical scenario on when they can be used, and I’m going to explain some characteristics of these collections, such as speed, if they are dynamic or not, if it accepts more than one data type etc. if you would like to go more in depth about arrays, or have some problems, you can read my blog where I explain about Arrays and ArrayLists.<br />
In this blog I will explain briefly the following collections; Array, ArrayList, List&lt;&gt;, HashTables, Dictionary&lt;&gt;, Stack, Queue<br />
<div class="bbcode_container">
	<div class="bbcode_quote">
		<div class="quote_container">
			<div class="bbcode_quote_container"></div>
			
				Collection:  Array<br />
Dynamic: No<br />
Generic: No<br />
Scenario: When we know the data type that we will store in the array, and it will have a fixed size that we know, for example we will only need only 5 inputs.<br />
C#: <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">string[] myStringArray = new string[5];</pre>
</div>Java: <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">String[] myStringArray = new String[5];</pre>
</div>
			
		</div>
	</div>
</div><div class="bbcode_container">
	<div class="bbcode_quote">
		<div class="quote_container">
			<div class="bbcode_quote_container"></div>
			
				Collection:  ArrayList<br />
Dynamic: Yes<br />
Generic: No<br />
Scenario: When we need to store mixed data types, because ArrayLists store data as objects, so we can store all the data that we need in different formats in one big ArrayList and when we need a dynamic collection, because we don’t know how many ‘slots’ we will need<br />
C#: <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:48px;">using System.Collections; 
ArrayList myArrayList = new ArrayList();</pre>
</div>Java: <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:48px;"> import java.util.ArrayList;
ArrayList myArrayList = new ArrayList();</pre>
</div>
			
		</div>
	</div>
</div><div class="bbcode_container">
	<div class="bbcode_quote">
		<div class="quote_container">
			<div class="bbcode_quote_container"></div>
			
				Collection:  List&lt;&gt;<br />
Dynamic: Yes<br />
Generic: Yes<br />
Scenario: When we know the data type that we will store in the collection, and when we need a dynamic collection, because we don’t know how many ‘slots’ we will need<br />
C#: <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;"> List&lt;string&gt; myList = new List&lt;string&gt;();</pre>
</div>Java: <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:72px;"> import java.util.ArrayList;
List&lt;String&gt; myList = new ArrayList&lt;String&gt;();
import java.util.LinkedList;
List&lt;String&gt; myList = new LinkedList&lt;String&gt;();</pre>
</div>
			
		</div>
	</div>
</div><div class="bbcode_container">
	<div class="bbcode_quote">
		<div class="quote_container">
			<div class="bbcode_quote_container"></div>
			
				Collection:  HashTable<br />
Dynamic: Yes<br />
Generic: No<br />
Scenario: When we will have different data types that we will store in the collection, and when we need a dynamic collection, because we don’t know how many ‘slots’ we will need<br />
C#: <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:48px;"> using System.Collections; 
Hashtable myHashTable = new Hashtable();</pre>
</div>Java: <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:48px;"> import java.util.Hashtable;
Hashtable myHashTable = new Hashtable();</pre>
</div>
			
		</div>
	</div>
</div><div class="bbcode_container">
	<div class="bbcode_quote">
		<div class="quote_container">
			<div class="bbcode_quote_container"></div>
			
				Collection:  Dictionary&lt;&gt;<br />
Dynamic: Yes<br />
Generic: Yes<br />
Scenario: When we know the data type that we will store in the collection, and when we need a dynamic collection, because we don’t know how many ‘slots’ we will need<br />
C#: <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;"> Dictionary&lt;int, string&gt; myDictionary = new Dictionary&lt;int, string&gt;();</pre>
</div>Java: <div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:48px;"> import java.util.Dictionary;
Dictionary myDictionary = new Dictionary()</pre>
</div>Sorry, but I’m not very sure about the Java Code.
			
		</div>
	</div>
</div><b><br />
Other</b><br />
Well, there are more Collections, such as the stack and the queue. These two are basically just like an ArrayList, but they have a special property, the queue is just like an everyday normal waiting list / queue because it’s a FIFO, first in, first out and the stack is the opposite LIFO, last in, first out.<br />
<br />
<b>Conclusion</b><br />
The collections that have &lt;&gt; are called generics, in the &lt;&gt; you will have to insert the data type that you will store in the collection, for example integers or strings or whatever. And the dictionary needs to parameters in the &lt;&gt; because one is the key value, just like a primary key in a database, it needs to be unique and it can be used for searching, and the other one is the value data type, meaning the data type that you will store in it.<br />
<br />
I hope that this was useful to you. If you see any errors in the point lists please advise me, I will fix it, because when using copy/paste it can get confusing, although I did check them.</blockquote>

]]></content:encoded>
			<dc:creator>TcM</dc:creator>
			<guid isPermaLink="true">http://forum.codecall.net/blogs/tcm/227-comparison-between-data-collections-arrays-etc.html</guid>
		</item>
		<item>
			<title>Data Dictionaries, a brief explanation</title>
			<link>http://forum.codecall.net/blogs/tcm/225-data-dictionaries-brief-explanation.html</link>
			<pubDate>Sun, 08 Feb 2009 17:03:02 GMT</pubDate>
			<description>*Data Dictionaries, a brief explanation* 
Data dictionaries are how we organize all the data that we have into information. We will define what our data means, what type of data it is, how we can use it, and perhaps how it is related to other data. Basically this is a process in transforming the...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore"><b>Data Dictionaries, a brief explanation</b><br />
Data dictionaries are how we organize all the data that we have into information. We will define what our data means, what type of data it is, how we can use it, and perhaps how it is related to other data. Basically this is a process in transforming the data ‘18’ or ‘TcM’ into age or username, because if we are presented with the data ‘18’, that can mean a lot of things… it can be an age, a prefix or a suffix of a telephone number, or basically anything! Maybe even an answer of a sum. But if we are presented with Age = 18, then that data is now information to us… because we know what that data represents, in this case that represents the age of someone. And to make an example of what how data can be related to other data, if for example we are presented with the data ‘TcM’, ‘18’ that can mean anything. But if we have Username = TcM, Age = 18 we know that the 18 is related to TcM, and it represents the Age of TcM.<br />
<br />
<b>Why use Data Dictionaries?</b><br />
We use data dictionaries because we know what that data means, so we know which data to use and when, what data is needed for a certain operation, what type that data is, and when we are designing a system we can define the type, for example an integer, of that data. So it will lead us to a more stable system / program and better documentation for the end-user and other technical people. Besides that Data Dictionaries can define what that data means in real-life.<br />
<br />
<b>What is their use?</b><br />
Well, one basic usage that came into my mind while writing this, this can help us design a class and to break down programming problems (read my previous blog for more information). This can help you define and design the classes needed to solve a certain problem. As an example (related to my previous blog) we can define that Account or User class will have for example a string representing the name, another string is representing the number, an integer being the PIN number. As you can see, we are defining the data type and what it represents.<br />
<b><br />
Data Dictionary Format</b><br />
Well, Data dictionaries vary in their format but usually their basic and most used format to have complete information about our data is:<br />
Name<br />
Alias<br />
Where-used<br />
How-used<br />
Content Description<br />
Supplementary Information<br />
<b><br />
Data Dictionaries Notation</b><br />
As many things in computing, these too have some notations, which are:<br />
= means is composed of<br />
 + means Sequence, and<br />
 [ | ] means Selection, either-or<br />
 {   }&#8319; means Repetition, ‘n’ repetitions of<br />
 (   ) means Optional Data<br />
 *  * means Delimits comments</blockquote>

]]></content:encoded>
			<dc:creator>TcM</dc:creator>
			<guid isPermaLink="true">http://forum.codecall.net/blogs/tcm/225-data-dictionaries-brief-explanation.html</guid>
		</item>
		<item>
			<title>Breaking Down Programming Problems</title>
			<link>http://forum.codecall.net/blogs/tcm/215-breaking-down-programming-problems.html</link>
			<pubDate>Thu, 05 Feb 2009 17:06:45 GMT</pubDate>
			<description><![CDATA[*Breaking Down Programming Problems* 
 
So, when I have an Assignment, or I need to create some software, or am presented with a problem, my first reaction is, 'WOA! This seems too complicated'... but being something that I really have to do I have to make it. I don't use any DSDM or methodologies,...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore"><b>Breaking Down Programming Problems</b><br />
<br />
So, when I have an Assignment, or I need to create some software, or am presented with a problem, my first reaction is, 'WOA! This seems too complicated'... but being something that I really have to do I have to make it. I don't use any DSDM or methodologies, they take too much time to make and I don't have all that time to make an assignment, because generally I am very restricted.<br />
<br />
So I start with reading the scenario and make a clear picture in my mind of what the result should look like and what are the functionalities of the end project. I first start by breaking down the scenario into pieces.<br />
<br />
For this example I will take a simple banking system, in case you are asking (if you read my other blog) yes, I seem to use the banking example all the time, it's because it's something basic and that everyone knows it's basic functionalities without having to blog about the scenario. But in this case I will use a simple ATM which you can withdraw and deposit cash on.<br />
<br />
I will start by braking it down into some simple points, which are:<br />
<b>Users (Clients)</b> -&gt; PIN -&gt; Login<br />
<b>Accounts </b>-&gt; Balance -&gt; Withdraw / Deposit<br />
<br />
These are the main functions / features that this ATM will need to work. Afterwards I will think about the basic logic behind it:<br />
A User (Client) will have one or more Accounts, to use the account he will need a PIN to login. When he logs in he can withdraw from his balance. If balance is 0 he cannot withdraw, or if the amount he wants to withdraw is more than the account balance an error will be shown.<br />
<br />
Basically that is the main idea. So, after that I will start creating / designing the classes.<br />
<br />
So mainly there are 2 classes that we already mentioned before... The Users and the Accounts. So, we create the classes and make the required fields / variables and methods. In this case we will create:<br />
<b>Account:</b><br />
	<b>Variables</b> - double Balance<br />
	<b>Methods</b> - Withdraw(double amount), Deposit(double amount)<br />
User:<br />
	<b>Variables </b>- int PIN, List&lt;Accounts&gt;<br />
	<b>Methods</b> – Login (int insertedPin)<br />
(Please note that this is just a rough outline of the system)<br />
So basically now I solved the problem. I know how it will work exactly, so if you know some basic coding you are ready to go, with some if statements and you have a working program. <br />
<br />
The next thing is, what if the user inputs anything that is not a valid double, such as “hello” or what if he tried to withdraw $ -100, or if he tried to deposit $ -100? We should take care of this either by a general try catch in the method, or handle them with some if statements. It’s up to you actually, but a simple try catch will work just fine!<br />
<br />
Well, I guess that’s it. I don’t write this on paper or anything, I usually think of all this as soon as I’m reading and understanding the scenario, and I start designing and coding straight away, and then take care of the exception handling.<br />
<br />
I hope that this simple example will let you understand how to approach complicated programming questions. Once you use this, it’s not that much complicated… and for small projects you don’t need to use any Methodologies or anything that much complicated, only an extra effort to think a little bit more…</blockquote>

]]></content:encoded>
			<dc:creator>TcM</dc:creator>
			<guid isPermaLink="true">http://forum.codecall.net/blogs/tcm/215-breaking-down-programming-problems.html</guid>
		</item>
		<item>
			<title>Arrays, an in depth explanation</title>
			<link>http://forum.codecall.net/blogs/tcm/210-arrays-depth-explanation.html</link>
			<pubDate>Wed, 04 Feb 2009 19:31:58 GMT</pubDate>
			<description><![CDATA[*Arrays, an in depth explanation* 
Well, this is my first blog. I'm planning to start blogging as much as I can. I will try to keep blogging, although I can't promise anything due to school and everything. Anyways, I'm going to blog what are Arrays, the different types of Arrays, advantages of each...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore"><b>Arrays, an in depth explanation</b><br />
Well, this is my first blog. I'm planning to start blogging as much as I can. I will try to keep blogging, although I can't promise anything due to school and everything. Anyways, I'm going to blog what are Arrays, the different types of Arrays, advantages of each types and so on. I will explain them in the most basic way for you to understand.<br />
<br />
<b>So, what are Arrays?</b><br />
Arrays are lists of variables that can hold certain data in them. These when declared reserve a certain amount of space in the RAM so you can store the data in them.<br />
<br />
<b>Why are Arrays useful?</b><br />
Let’s say that you want the user to input 10 different names or integers or whatever. For sure you are too lazy, and it’s inefficient to make 10 DIFFERENT variables to store that data, so look at the bright side… this is an advantage of being lazy, of course you won’t do it, but you still need to store that data, so that is when Arrays come in, you just declare ONE list and you will have 10 different slots to insert the data in.<br />
<br />
<b>So, what is the deal? Life is not that simple.</b><br />
Yup, you are 100% right. When you declare an Array list the first position is the first but not number 1. In most languages you have to access the first slot by the number 0, this will get you confused the first few times that you will use arrays when you will use it in a for or a for each loop. Believe me, you will have tons of ‘out of bounds’ exceptions, that is because you will loop from 1 to 10, but in reality the Array will only have from 0 to 9, so when it tries to access the slot in the 10th position it will not be found. So yes, that is the deal, life is not that easy… but after sometime you will automatically realize this as you are coding.<br />
<br />
And, another thing is, if you are making a for loop to loop through the array, it does make a difference if you make it loop from 0 &lt; 10, or 0 &lt;= 10. The 0 &lt; 10 will work, but the 0 &lt;= 10 will give you an ‘out of bounds’ exception. You might say, if we have from 0 to 9, why use 10? Simple, when you are starting with these things you will sometimes think in this way… we start from 0 but we have 10 slots, so you will use 10 instead of 9. But there are only 2 good combinations which are<br />
<br />
0 &lt; 10<br />
0 &lt;= 9<br />
<br />
This only applies if you will use the looping integer to access a specific location in an array. If for example you just want to make a loop and then in it make another integer to access the array, you use whatever numbers you want, as long as you will have the number of loops as the number of slots in the array.<br />
<br />
<br />
<b>Different types of Arrays</b><br />
There are 2 types of Arrays, dynamic and static arrays. What is the difference you might ask? The answer is simple, dynamic is something what keeps on changing, because it’s dynamic, this means that when you declare it you will not define the number of slots that you will have, as to the contrary static is something that will never change, so it will have a fixed number of slots.<br />
<br />
An example of a static array would be an integer array of 10 slots, if we had to use C# or Java it would be int[] myArray = new int[10];<br />
<br />
An example of a dynamic array is an ArrayList, if we had to use C# or Java it would be something like ArrayList myArray = new ArrayList();<br />
<br />
As you can see, in the first case we declared the type and the number of slots that we want; whilst in the second case we did not declare anything besides an empty dynamic array, which will hold the data as objects.<br />
<br />
<b>When to use which</b><br />
Well, this depends on your scenario. Let’s take a bank, in a banking system we can’t say look, we will only accept 1000 accounts and after that we will not give access to more users to create more accounts with us. Of course that cannot happen, because a bank wants as much users he can get and the number is indefinite! So in that case he will use a dynamic Array. Please keep in mind that this does not mean that a real bank uses ArrayLists, this is just for your understanding. Whilst let’s say that you want the user to enter ONLY 10 numbers, in that case you can use a static type of array.<br />
<br />
<br />
<b>Advantages and Disadvantages</b><br />
Well, some advantages is, Arrays make life much easier for us.. imagine we need to accept 100 numbers, we can’t afford (and are too lazy) to create 100 variables.. besides that if we do that we will only have a limited number, therefore that would mean it will be like a static array.. and when what would the bank do???<br />
<br />
You can easily read and write data to it with a simple for each, or for loop… instead of making num1 = 1; num2 = 2; etc… although we can do that in an array, we can make for example myArray[0] = 1; you just have to remember 1 thing, the array starts from 0 and not from 1 so we won’t get an error.<br />
<br />
Well, this is an advantage of dynamic arrays rather than arrays in general. Using a dynamic array will use less ram, because if we will insert 5 numbers instead of 10, we will only have 5 slots in the ram, but in a static array, if we insert 1 or 5, if we declared an array of 10 slots, we will have 10 slots in the RAM.<br />
<br />
Another disadvantages of static versus dynamic is that in static arrays if we need to search a specific something and get it’s position you will have to make a for loop and go through each and every slot and compare the data with the data you are searching for, but most dynamic arrays will have a built in search option, in C# it’s myArray.Contains(); theoretically this is much faster than the for loop that we will have to use for the static ones. But I can’t assure you of this, because last time I tried on a slow computer at school and tried to do some bench marking.. I could not see any difference, because both searches were done in a split of a split of a second, so could not test it properly. But, I think the most efficient way to search is using HashTables, which maybe we will discuss some other time.</blockquote>

]]></content:encoded>
			<dc:creator>TcM</dc:creator>
			<guid isPermaLink="true">http://forum.codecall.net/blogs/tcm/210-arrays-depth-explanation.html</guid>
		</item>
	</channel>
</rss>

