[cs631apue] initialized and uninitialized data segment in memory

Jan Schaumann jschauma at stevens.edu
Thu Oct 22 13:13:53 EDT 2020


Mingyao Xiong <mxiong3 at stevens.edu> wrote:
> Is it right that if a global variable is initialized
> with a value other than zero, then it will be found
> in initialized data segment?
> 
> If a global variable is uninitialized or initialized
> with zero, it will be in the uninitialized data
> segment. And exec will initialize it with zero.
> 
> Is my comprehension correct?

Yes, that's correct.

You can confirm your understanding via the
memory-layout programs posted on the course website --
add change some of the values and observe their new
memory addresses.

-Jan


More information about the cs631apue mailing list