I have looked at a few tutorials that i could find online, but i still dont get exactly what they are used for and what the difference between going Blah[64] and Blah[8][8] is. Thanks

Recommended Answers

All 5 Replies

The difference is how you want to view the array. Bla[64] is just a one, dimensional array that contains a simple list of items, for example you could have an array that contains a list of 64 varieties of fruits and vegies. The Bla[8][8] is an two dimensional array, such as one that you might see when you are using Microsoft Excel spreadsheet. It contains 8 rows and 8 columns. The rows could represent the names of students while the columns represent the names of fruits and vegs that they eat.

Another example of a two dimensional array is the rows represent student ID numbers and the columns represent the student grades of exams during the semester. You can extend this concept to a three dimensional array such as Bla[5][8][8], which is the examp test cores for 5 different classes.

i see, that makes sense. So say i want to store someones name and their number. Using the [8][8] example, i would store the name at [1][1] and the number at [1][2] or however u want to arrange it. Correct? And then you can call it using pointers?

Check out a visual: (I love drawrings) hehe

nice, visuals always help me understand things better also, thanks! Also, i can store any kind of information or commands etc. inside of an array element right? Not just chars?

Variables, pointers to variables, pointers to pointers, pointers to objects, . . .

I mean, yes... any variable

int, string, char, double, etc etc etc

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.