Chapter 10


  1. While the data type of an array may be integer, float, or character, a particular array cannot contain integers, floats, and characters . All the elements of an array must be of the same data type.

  2. The number of the starting index of an array is zero.

  3. The number of the ending index of an array is one less than the number of elements in the array.

  4. Initialization is when you assign a value to a variable in the same statement in which you declare that variable. By contrast, assignment is when you assign a value to a variable in a statement after the one in which you declare that variable.

  5. The two alternative methods of initializing an array are explicit initialization, in which the square brackets contain a numerical constant indicating the size of the array, or implicit initialization, in which the square brackets are empty and the size of the array is indicated by the number of elements on the right side of the assignment operator.

  6. The purpose of the null character is to signal cout when to end the output of a character array.

  7. The value of the name of an array is the base address of the array.

  8. The last element of a character array need not always be a null character. When each element of a character array is separate from the other, such as a separate grade for each test, there is no need to use a null character. However, if the character array elements are related , such as a character array representing a persons name, then usually the last element should be a null character.

  9. The get function reads the user s input up to, but not including, the newline character, whereas the getline function reads the users input up to and including the newline character.

  10. When you pass an array name as a function argument, you are passing it by address.




C++ Demystified(c) A Self-Teaching Guide
C++ Demystified(c) A Self-Teaching Guide
ISBN: 72253703
EAN: N/A
Year: 2006
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net