I'm looking at the question in a totally different light than anyone else--excluding Hershlag (being a video game programmer).
Code:
//code using const
const long clong = 100;
int main(int argc, char **argv) {
long num;
num = clong;
return 0;
}
Now
Code:
#define CLONG 100
int main(int argc, char **argv) {
long num;
num = CLONG;
return 0;
}
Okay, here is the big difference I see with these example. The first declares clong--a constant long--which happens to be global. The second declares no global variable, rather it has a number to put in the place of the word CLONG during compilation. The advantage of the #define here is that no extra memory is taken up to hold that 4bytes of space that could have easily been saved by using a #define. However, this doesn't typically alter the size of an executable. But it does optimize the amount of memory used.