View Single Post
  #5   Spotlight this post!  
Unread 25-01-2005, 02:05
ericand's Avatar
ericand ericand is offline
Registered User
AKA: Eric Anderson
FRC #3765 (Terrabots)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: St. Paul, MN
Posts: 148
ericand is a jewel in the roughericand is a jewel in the roughericand is a jewel in the rough
Re: reprogram during a competition

If you need a sufficiently small number of values, table lookup will
save space. It just depends on how many you need. In the general
case, an algorithm will save space and table lookup will optimize for speed.

The use of #define will not necessarily save space (except in your
source files, where you don't care). It depends on how you are doing things.
To save space with constants, you want every reference to the value of the
constant to be to the same memory location. If you just use the define, you
will be storing the constant value everywhere it is used.