Trouble with #defined identifier in c++ -


i"m writing program ,extensively, depends on identifier:

#define number_of_elements 12 

the parameter used in number of projects (in 1 solution). problem have 2 modes: first number_of_elements 12 , second number_of_elements equals 16.

is there way change value of parameter during run-time? if not there work-around?

thanks in advance!

#define provides constants pre-processor. not available @ runtime or directly compiler itself.

you need use runtime variable if want value changed @ runtime. best way define depends great deal on structure of program.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -