In the link
it is written that
When you write

const int num2 = 45;

on the other hand, the main part of the compiler allocates a variable, of type int, and initializes it with the value 45, and makes a note to itself that it should complain if you ever try to modify this variable anywhere else in the source file.

I heard that for const variables memory is allocated in ROM.So,I think at compile time it is allocating memory in ROM and it is storing value there.But it is substituting the value at run time.Am I correct?