Home > Back-end >  Why long long a [20190326] array defined inside the main function not lose anything, outside the mai
Why long long a [20190326] array defined inside the main function not lose anything, outside the mai

Time:10-16

This topic comes from 2019 blue cup third topic

CodePudding user response:

Is too big, the internal hold, global variables can withstand

CodePudding user response:

One is defined on the heap, is defined on the stack, the default stack space fit inside this array,

CodePudding user response:

Local variables are inside the system stack, stack is generally around 100 KB size
How old 20190325 * sizeof (long long), 160 MB

Global variables are data areas in the procedures section, this can be very big, and it is the default is automatically initialized to zero, the data={0} could not write; Local variables must write the initial value
  • Related