Re: A89: Re: C problem...


[Prev][Next][Index][Thread]

Re: A89: Re: C problem...




Hi!

Another small suggestion:

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.

To define a type for the initials, use the following:  (I don't know if it
works, though; I haven't done C for very long.)
typedef char initialstype[4];  (if it doesn't work, maybe 'typedef char[4]
initialstype')
static initialstype initials={0,0,0,0};

Then the function would be:
void end(int score,int *highscore,initialstype *initials)

Also, '%c' has to be changed to '%s', as stated before.

Bye,

Sebastian Reichelt




References: