Thread: Editing Main.c
View Single Post
  #8   Spotlight this post!  
Unread 31-01-2004, 23:55
KevinB's Avatar
KevinB KevinB is offline
Registered User
AKA: Alum
no team
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2001
Location: AL
Posts: 188
KevinB will become famous soon enoughKevinB will become famous soon enough
Send a message via ICQ to KevinB
Re: Editing Main.c

Quote:
Originally Posted by mtrawls
What? #include statements are pre-processor directives ... they are (quite necessarily) executed before compilation and definately before you upload the code to the robot. For conditional includes, you'd have to use the pre-processor directive #ifdef ... #endif -- but this isn't what you mean to do.
I didn't use #ifdef or #endif because thats not what I'm trying to accomplsh. The #include directive simply takes the contents of that file and shoves it into the spot where the #include line was.

You get the conveinence of having the autonomous routine in 1 file and the main routine in the other file, and you save the CPU cycles necessary to jump to and from the function.