View Single Post
  #1   Spotlight this post!  
Unread 04-29-2005, 03:10 PM
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0395 (2Train Robotics)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Long Island City, NY
Posts: 1,433
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
#define and #ifdef/endif

If I have code that says (example only)
Quote:
if(rc_dig_in01==1)
#define PROG1
else if(rc_dig_in02==1)
#define PROG2

#ifdef PROG1
printf("Hello, world.");
#endif
#ifdef PROG2
printf("FIRST Robotics");
#endif
Will the printf's change when i flip either of the switches? Basically, my question is if code between #ifdef/#endif is loaded onto the robot, and whether or not variables can be defined on the fly, based on switch input.

Thank you in advance,