View Single Post
  #8   Spotlight this post!  
Unread 21-01-2006, 19:59
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: "call of function without prototype"

Yes, the .h files condense stuff. In another way, they making changing things easy. For example, last two years I used a file called "defines.h". In it I had stuff like this:

Code:
#define DRIVE_LEFT pwm01
#define DRIVE_RIGHT pwm02
This provided two advantages: 1) I could easily change the mappings of our pwm's around, and 2) When it came time to wire the robot, I printed off this file, and it was easy to match PWM's to their function.

The first reason was the main reason to change something. If you need to add another parameter to a function, and its in a .h file, then you change it there, and any code that used the old version would be highlighted.. with it defined in multiple .c files, you could get some strange errors.