The first sample code; &quot;This program segfaults because the entire stack is set to 0 at program start.&quot;<p>I&#x27;d be surprised; as a strong general rule, the stack does not get zeroed [Edit: see end of thread! It&#x27;s the OS zeroing everything - learn something very day]. I&#x27;d expect it to segfault because the pointer value is whatever leftover non-zero value happens to be in that piece of memory, so it points into random memory the user program shouldn&#x27;t be messing with (sticking in a printf to output the value of the pointer confirms this on at least one system). Wouldn&#x27;t be surprised if some implementations took security really seriously and zero everything, or if a debug build was zero happy, but under normal circumstances, the stack doesn&#x27;t get zeroed.