2-D arrays

2-D arrays - 2-Dimensional Arrays • • • • • •...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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

Ask a homework question - tutors are online