View Single Post
  #3   Spotlight this post!  
Unread 04-29-2005, 03:23 PM
devicenull devicenull is offline
Robot? We need a robot?
no team
 
Join Date: Sep 2004
Rookie Year: 1234
Location: n/a
Posts: 359
devicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nice
Re: #define and #ifdef/endif

Code:
#ifdef PROG1
printf("Hello, world.");
#endif
#ifdef PROG2
printf("FIRST Robotics");
#endif

If we #define PROG1, then it puts the "Hello, world" printf in.
If we #define PROG2, then it puts the "FIRST Robotics" printf in.

I used these for a few sensor values that differed from our practice to competition robot.. I'll post the code we used when I get a chance.