(Borrowing from earlier posts) A literal constant is a value entered directly into your program where necessary. for example
int breakpoint = 10;
The control point of a variable is an integer (int); 10 is a literal constant. You cannot assign a value of 10, and its value cannot be changed. Unlike a variable, a constant cannot be changed after it is assigned a value (initialized).
A symbol is what the compiler deals with. In this example, TEN is a symbolic constant created using the #define function. #define is something the compiler doesn't even know about, because the precompiler converts it to an assigned (defined) value. The precompiler searches and replaces each character constant inside your program with a value.
#define TEN 10 breakpoint += TEN;
The precompiler translates it to
Breakpoint += 10;
The compiler never sees TEN, but only its assigned value, 10. Why is this useful? What if the breakpoint changes to 11. Instead of looking at the entire program and changing each variable definition to a new value that was set using the literal constant, 10, change the definition of one character constant ... TEN to 11 and let the precompiler insert changes for you.
crashmore
source share