TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: RICK ARDING
from: DARIN MCBRIDE
date: 1997-03-24 22:35:00
subject: .

 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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.