how's the constants declared with keyword const is allocated in the program? if i declared a constant as a global, when the memory is allocated? when the program start running? i think so.
but how about the constant in function? when the memory is allocated for it? it's allocated when the program start running like global or when the execution reach inside that funtion?
i want to know this for static object too. the static variable is allocated (definition) for 1 time only, but what's the time it occurs?
and this apply also to the char point declared like:
the location pointed to by s is a constant memory location or...?
but how about the constant in function? when the memory is allocated for it? it's allocated when the program start running like global or when the execution reach inside that funtion?
i want to know this for static object too. the static variable is allocated (definition) for 1 time only, but what's the time it occurs?
and this apply also to the char point declared like:
Code:
{
char *s = "hello world...";
}
the location pointed to by s is a constant memory location or...?