Module 2 Flashcards
(12 cards)
is a collection of similar elements of same data type at a contiguous memory location.
array
Components of Array
Array name
index type
base type
collective name for the array element.
Array name
set of subscripts that are used to differentiate one element to another.
Index type
data type of array element.
Base type
Also called as linear array
One Dimensional Array
The entire array has only one name. However, you need to be able to refer to individual elements of the array.
ARRAY INDEX
TYPES OF ARRAY
- ONE-DIMENSIONAL ARRAYS
- MULTI DIMENSIONAL ARRAYS
declares the base type/data type of the array.
type
specifies the number of elements that an array can hold.
size
is used when you have to take input strings which have spaces in between them.
getline() function
returns an integer, which is a measure of the difference between the two strings.
compare()