My teacher was talking about constant variables, and I was thinking that since the variable is assigned a value when its declared and never changes, would it not be faster to use a #define? That is unless the value was based on some runtime event/calculation?
EX:
#include <iostream.h>
const int DOZEN = 12;
main() {
cout << "There are " << DOZEN << " units in a Dozen.\n";
}
wouldnt it be faster to use the #define in a case like this? Since define is a preprocessor directive, and all instances of it will just be replaced with the number at compile time, it wouldnt have to access memory for the variable would it?