|
Re: Compiler Help Needed
As an example, when using a microcontroller, using this:
#define PI (22 / 7)
is *considerably* faster than using 3.14159... and it gives a fairly decent approximation.
Also, to prevent re-inclusion of header files, people usually do something like this:
myheader.h
#ifndef MYHEADER_H
#define MYHEADER_H
.. Entire header file ...
#endif
/* ifndef MYHEADER_H */
This prevents weird recursion problems from having a header file included twice at the top of a C file.
It's sloppy, and I don't recommend doing this, because if you *need* to do this, you're already down the dangerous road they've been speaking of and you ultimately need to fix that or you'll just have a *monstrous* headache at competition when you're rapidly changing code.
__________________
Team 677 - The Wirestrippers - Columbus School for Girls and The Ohio State University
EMAIL: mccune@ling.ohio-state.edu
...And all you touch and all you see
Is all your life will ever be...
|