Unformatted text preview: 2-Dimensional Arrays
• • Can define one array for multiple sets of data
Like a table in a spreadsheet
Use 2 size declarators in definition:
const int ROWS = 4, COLS = 3;
int exams [ROWS] [COLS];
first declarator is number of rows, second in number of columns
o columns and rows are numbered starting with 0
larger than 2-D arrays:
gender x major x city x age
2 x 100 x 30 x 25
You can use arrays with more than 2 dimensions ...
View Full Document
This note was uploaded on 06/20/2011 for the course CSC 1253 taught by Professor Staff during the Fall '08 term at LSU.
- Fall '08