Thank you.But my doubt remailns like that.In another site
it is written
const int COMPILE_TIME = 5; // set at compile-time; its value is 5 (five)
int read_int() { int val; std::cin >> val; return val; }
const int RUN_TIME= read_int(); // set at runtime; can be any value

and so we can use COMPILE_TIME it in arrays,switch-cases.But we can't use RUN_TIME in arrays and so on.Can we do like that?

one more doubt.For constants memory is allocated in which memory segment.stack,heap or someting else.