I saw in the code next statement:
SomeType someVar[1];
Later someVar
is used as a pointer to SomeType
. Why would one
SomeType someVar[1];
someVar
is an array of type SomeType
with 1 element.
SomeType* someVar;
someVar
is a pointer (dangling still, you didn't point it to anything yet) of type SomeType
.
And you can use the name of an array on its own as a shorthand for a pointer to the first element of that array.
Will Dean