The difference between #define and const

mmcp42:
If I understand it correctly...

constant int TheValueOne=1;

will take up memory

#define TheValueOne 1

doesn't take up any space

so I guess it saves a byte or two

can't work out why "constant int" is "more modern" though?

That is not true, and depending on the compiler a define may take up more memory than a const. The thing is that the define sort of creates a copy (maybe several copies if you use it a lot) of the value, whereas the const int is a single object. Think about it, where is the 4 stored? It must be in the memory somewhere.

I'm no Arduino compiler expert, but it could be that #define is faster when it comes to execution.