Altera_Forum
Honored Contributor
15 years agoInitializer Element Not a Constant Error
I've declared a variable, but I'm trying to initialize it not with a# define, but rather a const variable. Something like:
const alt_u16 solid = 10; alt_u16 varState = solid; I though the compiler would put all 'const' variables in program memory, and therefore it should allow another variable to initialize itself with the const value... unfortunately, the compiler (9.1sp2) generates an error. Anyone know of a way to do this? I know I could just use a# define, but for type checking and debugging I prefer using constants. Thanks!