How Strings and
Arrays are Alike
Strings are numeric arrays.
Not only are they numeric arrays, they are the simplest of numeric
arrays since they only require one bit of storage per element.
This is exactly the same as numeric arrays except for one
slight modification:
We must know the base address of
the array and where the string ends. If we were to add
an additional character at the end of the string, we
could check to see if we have reached the end of the
string.
Things to know
about Strings vs. Numeric Arrays
|
Strings are viewed slightly differently from numeric
arrays because?
|
Well, strings ARE
numeric arrays of type character, but we are not necessarily
interested in each offset from the base address. All we care
about strings are where they begin (at the base address) and
where they end (with the NULL (?\0?) character.