Thread: Aliases
View Single Post
  #8   Spotlight this post!  
Unread 11-02-2003, 01:07
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Re: sooo....

Quote:
Originally posted by Anthony Kesich
so then why alias a variablle to different names? if they all equal the same thing, why not just use the same one again and again, it would save code and space. Is it just for ease and readability?

-Kesich
That's the main reason. The other reason is if you want to access smaller portions of a variable. For example, relay1_fwd is an alias of the relayA variable, but only points to one bit inside it.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php