Solved Need help understanding arrays in turbo pascal

April 7, 2013 at 17:00:34
Specs: Windows 7
We are currently doing Arrays in class, I get the concept ( used to store multiple numbers into one unit?). But I don't really know how to apply it to a program and make it work. Any help would be appreciated.

See More: Need help understanding arrays in turbo pascal

Report •

April 7, 2013 at 18:04:56
✔ Best Answer
An Array is just a collection of related data, all with the same name but an index number to identify individual items.

So an array called MyData with five elements would contain five different pieces of data

You would access the data my using MyData(3) with will give you the third item in the list.

How you would use them in a program depends on what the programme is meant to achieve

Arrays are often used inside For Next loops where the For/Next counter is used to address each element in the array.


Report •

April 7, 2013 at 23:52:07
One small correction - Pascal arrays use square brackets. So it's MyData[3].

@OP - if you don't understand something on your course I would strongly recommend that you discuss it with your tutor. (S)he knows you, your needs, and your level of knowledge, far better than we do and can give advice tailored to your needs. Teachers are paid to teach you, so make sure they earn their pay.

Report •

Related Solutions

Ask Question