Forum Discussion
Altera_Forum
Honored Contributor
19 years agoinitializer element is not a constant
How can I get rid of the following error: initializer element is not a constant? I use NIOS II IDE in the C programming language. Before I had the code: # define ip1 134# define ip2 35# ...
Altera_Forum
Honored Contributor
19 years agoI assume you are using C not C++? A quick test showed that it should work in a *.cpp file but not in a *.c file. If you really want to get rid of the defines you could use something like
enum ip {
ip1 = 134,
ip2 = 35,
ip3 = 134,
ip4 = 112
};