While reading about the "read only" string and came across the below snippet.
#include<stdio.h>
main()
{
char *foo = "some string";
char *bar = "some string";
printf("%d %d\n",foo,bar);
}
What i understood is foo and bar both will print the same address, but I am not able to understand what actually happening in background. i.e. When the string is same it will return same address but when I modify the string addresses are different.