Where are arrays stored in C?

This question already has an answer here:

  • Stack variables vs. Heap variables 8 answers

  • If int x1[5]; doesn't defined in any function, the array x1 is on your program's bss segment , variable x1 is a global array.

    If int x1[5]; defines in any function, the array x1 is on your program's stack during executing this function.


    I believe int x1[5]; goes on the stack.

    链接地址: http://www.djcxy.com/p/82534.html

    上一篇: C ++模板typedef

    下一篇: 数组在C中存储在哪里?