RA> THE FUNCTION
RA> int ShowThing(struct Thing *T)
RA> {
RA> struct Thing TT; /*CAN'T DEAL WITH THE PASSED STRUC*/
RA> TT=*T; /*SO I HAVE TO USE A DUMMY ONE */
RA> gotoxy(TT.Across,TT.Down);
RA> putch(TT.ThingChar);
RA> *T=TT;
RA> return(1); /*THEN I COPY THE DUMMY TO *T */
RA> }
Try:
int ShowThing(struct Thing *T)
{
gotoxy(T->Across, T->Down);
putch(T->ThingChar);
return 1;
}
For pointers, the arrow operator (->) gets at the variable pointed at, like
the dot operator does for the objects themselves.
RA> Is there a more logical way to do this? Sometimes I think C just isn't
RA> worth the effort, with all of its little idiosyncrasies.
For more C questions, might I recommend using the C_ECHO instead?
--- Maximus/2 3.01
---------------
* Origin: Tanktalus' Tower BBS (PVT) (1:342/708)
|