Consider this code:
const char* someFun() {
// ... some stuff
return "Some text!!"
}
int main()
{
{ // Block: A
const char* retStr = someFun();
// use retStr
}
}
My question is in the function sumFun()
where is "some Text!!", stored (i think may be in some static area in ROM) and what will be its scope?
Will the memory pointed by retStr
be occupied throughout the program or be released once the block A exits?
--
Thanks