Re: A89: Re: C problem...
[Prev][Next][Index][Thread]
Re: A89: Re: C problem...
> > Instead of increasing the pointer that you pass as a parameter with
> > 'initials++', let that pointer stay the same, and use
> '*initials[count]=key'
> > instead of '*initials=key'. Since C is a high-level programming language,
> > you shouldn't have to mess around with pointers that much.
>
> When I try this the compiler says "invalid type argument of 'unary * '
> "...why does it say this?
Because "*initials" isn't an array, but "initials" is. Use "initials[count] =
key" instead.
In C the variable you use as an array name is in reality a pointer to a memory
area with the array's element types in order.
/ Niklas Brunlid
Check out Prosit for the TI-89 / TI-92+ at http://prosit.ticalc.org
Random PQF Quote follows:
The duke had a mind that ticked like a clock and, like a clock, it
regularly went cuckoo.
-- (Terry Pratchett, Wyrd Sisters)
Follow-Ups:
References: