As per my understanding there is four segment where memory gets allocated i.e.code,data,bss and heap. My question in which segment does a string literal gets allocated?
int main(){
char *ptr = "abcd";
}
In the above program where the memory for string literal gets allocated. And where ptr
gets allocated? in stack?