0

I have a question on my handout for class that says:

Justify / refute the statement that theese declarations are equivalent.
double speed[1] ;
double speed;

My guess was they are the same, since, even though speed[1] is an array, it is the same size of just speed.

Am I wrong?

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Narue
0

>Am I wrong?
Yes, they're different in pretty much every way due to the differing syntax and semantics of scalars and arrays. You can't even say that they have the same storage costs because arrays are allowed to use extra space before and after the accessible items.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.