View Single Post
Old 12-15-2004, 08:04 AM   #29
ASk
No purchase necessary!
 
ASk's Avatar
 
Join Date: Mar 2002
Location: Israel
Posts: 525
Quote:
The warning is: warning C4204: nonstandard extension used : non-constant aggregate initializer
Just a little clarification - you may only initialize a const with a constant expression (i.e a number). The reason for this is simple - when the compiler compiles your code, the const variable is replaced by its value everywhere it appears. Initializing it with the value of another variable can't be resolved until run-time, therefore it's not an acceptable behavior.

Since the const variable must be resolved during compile time and not run-time, you get that error.

ASk is offline   you may: quote & reply,