If I understand correctly that global variables (which go into the data segment) in C are initialized, where automatic variables (which go into the stack) are not. or perhaps the other way around?
Why is that? Why doesn't the compiler initialize both kinds of variables? Does speed increase, etc.
As you say, global variables fall into the data segment, so their value is contained in the final executable file, and it can also be an initialized value, since in any case there is no difference in performance.
, , , .
, , auto - . , , "", - , (..: ).