Literals, be they:
- number literals, like
4
- string literals, like
"Hello, World"
Have a 'static
lifetime as their value is hard-coded into the library or executable itself. For example, on Linux, they would be found either in the .text
segment or the .rodata
segment of the ELF binary.
In that sense, you can think of them as being owned by the program itself.