L
Les Cargill
I am using Mingw 3.4.5 on a 'Doze box, but it pretty much
follows any Gnu compiler I've run into.
Why is this:
---------------------------
#define SIZE 20
const int size = SIZE;
char array[SIZE];
---------------------------
legal, yet
---------------------------
#define SIZE 20
const int size = SIZE;
char array[size];
---------------------------
not?
The int size is invariant, and ... "morally"
equivalent to using SIZE, yet it won't let me do that.
And yes, I understand/speak/grok preprocessor vs.
compiler. I know *how*, I just wonder *why*. Is
this a practical, strategic or tactical thing,
or am I just being silly? Was it a conscious decision
of the committee, or just one of those things?
Thanks in a advance for any consideration.
follows any Gnu compiler I've run into.
Why is this:
---------------------------
#define SIZE 20
const int size = SIZE;
char array[SIZE];
---------------------------
legal, yet
---------------------------
#define SIZE 20
const int size = SIZE;
char array[size];
---------------------------
not?
The int size is invariant, and ... "morally"
equivalent to using SIZE, yet it won't let me do that.
And yes, I understand/speak/grok preprocessor vs.
compiler. I know *how*, I just wonder *why*. Is
this a practical, strategic or tactical thing,
or am I just being silly? Was it a conscious decision
of the committee, or just one of those things?
Thanks in a advance for any consideration.