Summary

  1. An array is used to store homogeneous data, i.e. data of the same type.
  2. All the elements of an array have the same name, i.e. the array name. They are distinguished on the basis of their locations in the array. Locations are specified by using an integer value known as an index or a subscript.
  3. Arrays are also known as indexed variables or subscripted variables.
  4. Array index in C starts with 0.
  5. C does not provide array index out-of-bound check.
  6. Arrays are stored in contiguous (i.e. continuous) memory locations.
  7. Arrays are classified as single-dimensional arrays and multi-dimensional arrays.
  8. Subscript operator is used to access the elements of an array.
  9. The array name refers to the address of the first element of the array and is a constant object.
  10. An array cannot be assigned to or initialized with another array.
  11. If an array is equated with another array, it always evaluates to false.
  12. A pointer is a variable that holds the address of a variable or a function.
  13. Restricted arithmetic can be applied on pointers. Arithmetic on pointers is governed by pointer arithmetic.
  14. Addition of two pointers, addition of a float or a double value to a pointer, application of multiplication and division operators on pointers are not allowed.
  15. void pointer is a generic pointer and can point to any type of object.
  16. Dereferencing a void pointer and applying pointer arithmetic to it is not allowed.
  17. Null pointer is a special pointer that does not point anywhere.
  18. Dereferencing a null pointer leads to run time error.
  19. An n-D array is an array of (n-1)-D arrays.
  20. The expression of form E1[E2] is implicitly converted to an expression of the form *(E1+E2).
  21. In C language, multi-dimensional arrays are stored in the memory by using row major order of storage.

Post a Comment

Previous Post Next Post