Can someone explain to me what arrays are? So I can understand them? thank you.
Printable View
Can someone explain to me what arrays are? So I can understand them? thank you.
An array is a fixed size collection of objects (aka elements). They can be any type that C supports, such as char, int, struct, union, pointers, double, float.
--
Mats
you can start off at http://www.cprogramming.com/tutorial/print/lesson8.html
An array is a number of something. For example, a char array would be a number of datatype char. They are convienently numbered in order and referred to with one name. This allows you to work with strings, like "this is a string", because "this is a string" contains 15 characters.
and for an impromptu definition..."a logically contiguous row of memory locations used for storing data"
I like that definition.
A bunch of something... int array[45] means you have a list of 45 ints. array[0] would be the first and array[n-1] would be the last. Since in this case n = 45, n-1= 44. so array[44] is the last index of the array.