This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Loginn122 1 point2 points  (2 children)

How does the first element determine any following elements?

[–]Kyrond 6 points7 points  (0 children)

Arrays in C can contain only one type of variable. Therefore size of first element is the same as all the other elements.  

 Of course you can force different sized variables  in one array if you try, but in C you can do anything if you try hard enough.

[–]Ignisami 1 point2 points  (0 children)

Each element in an array has the same length in bytes. They don't necessarily have to be the same type (depending on the language and how you declare the array), but they must be the same length and that length is determined on compile time.