Can someone explain to me what arrays are? So I can understand them? thank you.
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
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
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.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
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.