From 81397599fbbfd239cbad51c8ce201f39cef302e1 Mon Sep 17 00:00:00 2001 From: Jadon T Schuler Date: Mon, 22 Apr 2024 11:53:21 -0500 Subject: [PATCH] Update c_memory_model.tex String literals are stored in read-only, not code (at least not in modern standards) --- introc/c_memory_model.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/introc/c_memory_model.tex b/introc/c_memory_model.tex index 27bfb4fb..1aa195dd 100644 --- a/introc/c_memory_model.tex +++ b/introc/c_memory_model.tex @@ -146,7 +146,7 @@ \subsubsection{String literals are constant} strcpy(ptr, "Will not work"); \end{lstlisting} -String literals are character arrays stored in the code segment of the program, which is immutable. +String literals are character arrays stored in the read-only data segment of the program, which is immutable. Two string literals may share the same space in memory. An example follows.