Skip to main content
Logo image

Section 17.2 Arrays of Other Data Types

Arrays are not limited to just holding integers, rather they can hold other data types as well, such as floats. The only limitation is that all data stored in a given array must be of the same data type, so all could be integers or all could be floats or all could be characters, etc.

If you cannot see this codecast, please click here.

Check Your Understanding Check Your Understanding

1.

    Which declaration reserves space for 10 floats?
  • float num[10];
    
  • Correct
  • float(10) num;
    
  • Not quite. Try again!
  • float num(10);
    
  • Not quite. Try again!
  • float[10] num;
    
  • Not quite. Try again!