3 Replies - 138 Views - Last Post: 07 February 2012 - 01:45 PM Rate Topic: -----

Topic Sponsor:

#1 namich  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-February 12

A better understanding of arrays

Posted 07 February 2012 - 12:07 PM

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.
Is This A Good Question/Topic? 0
  • +

Replies To: A better understanding of arrays

#2 modi123_1  Icon User is offline

  • Suiter #2
  • member icon


Reputation: 3561
  • View blog
  • Posts: 14,989
  • Joined: 12-June 08

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.
Was This Post Helpful? 1
  • +
  • -

#3 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 533
  • View blog
  • Posts: 1,283
  • Joined: 30-January 11

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.
Was This Post Helpful? 1
  • +
  • -

#4 DimitriV  Icon User is offline

  • It's been so long, without this feeling
  • member icon

Reputation: 513
  • View blog
  • Posts: 2,533
  • Joined: 24-July 11

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
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!
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1