Hello guys,
I am trying to get a better understanding of the uses of arrays in programing, and have been wondering why do programmers use an array when working with mathematical concept such as Fibonacci sequences? why are arrays so prevalent in coding now a days.
A better understanding of arrays
Page 1 of 13 Replies - 138 Views - Last Post: 07 February 2012 - 01:45 PM
Topic Sponsor:
Replies To: A better understanding of arrays
#2
Re: A better understanding of arrays
Posted 07 February 2012 - 12:13 PM
People enjoy using arrays for they provide a quick indexed collection of similarly liked objects.
#3
Re: A better understanding of arrays
Posted 07 February 2012 - 12:18 PM
They also get around some potentially horrid variable naming situations.
Say in a program I needed 10 strings for some reason or another. Without an array -
string1, string2, string3, string4 .... and so on.
With an array, just one good name for all of them and no maintenance nightmares if I wanted to change the names to myString1, myString2 ... etc.
The problem escalates if say I needed fifty or more strings.
Say in a program I needed 10 strings for some reason or another. Without an array -
string1, string2, string3, string4 .... and so on.
With an array, just one good name for all of them and no maintenance nightmares if I wanted to change the names to myString1, myString2 ... etc.
The problem escalates if say I needed fifty or more strings.
#4
Re: A better understanding of arrays
Posted 07 February 2012 - 01:44 PM
Yep. I'm going with Modi here:
An array is a collection of a certain data type with items accessible through
Which gets the item at index 0. You can add items to them, remove items, use all sorts of loops with them, you can give them a limited size!
An array is a collection of a certain data type with items accessible through
MyArray(0)
Which gets the item at index 0. You can add items to them, remove items, use all sorts of loops with them, you can give them a limited size!
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|