How is read-only memory implemented in C?
I heard that in C, if I do char *s = "hello world". the "hello world" is actually stored in read-only memory. I am not so clear about read-only memory. What is the explanation? Is that like a flag to the compiler that tells the compiler to do not write into that section? Nils Pipenbrinck That's not a feature of the C language but a feature of the compiler/linker and the operating system working together. When you compile such code the following happens: The compiler will put the string into a read-only data-section. The linker collects all the data in such read-only sections and puts them into