I'm just curious what the actual advantage is to holding variables in an array versus declaring several variables. It seems to me that the two are virtually the same.
Does it reduce file size by not having to type up "char" so many times? Does it retrieve values from memory more efficiently when the variables are called upon? Obviously, arrays wouldn't exist without good reason, so I would use them when able. Just looking for some background theory I guess.
It stores them in memory exactly the same way.
However, think of this scenario.
Let's say I want you to type in 10 temperatures and i'll find the average.
If I don't use arrays, my code would look like this.
Note: This is crappy code that doesn't even do error checking, but it just to prove a point. Also note that if we were to implement error checking for this, it would show an even more drastic difference in lines of code/readability.