Arrays

Like Java arrays, C/C++ arrays contain data selected (subscripted) by integer values. The smallest subscript is zero, and the largest is one less than the size. That's about all the similarities to Java. Here are some differences.

  1. C++ arrays may be allocated in several ways, none of them exactly like Java.
  2. C++ arrays are intimately related to pointers, which can be used to record locations in arrays.
  3. Java checks that subscripts are in range and throws an exception if not. C completes the operation without checks, and results are unpredictable.