search

Home  >  Q&A  >  body text

c++ - C语言堆区基础问题,我是小白刚学C的

1.请问各位大神堆区除了被程序员释放,还能被什么释放吗?
2.请问如果计算机掉电了堆区会怎么样呢?会被释放?会丢失?还是会怎么样?

本人小白,请各位大神说的直白点就好,刚刚学C没多久突然有此疑问

伊谢尔伦伊谢尔伦2785 days ago696

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 15:27:13

    1. When the process (the program you wrote) ends, the operating system will reclaim various resources including memory

    2. No problem, the same piece of memory will be used for other things after the next boot. So the memory is called "volatile storage"

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 15:27:13

    The heap area (heap) is generally allocated and released by the programmer. If the programmer does not release it, it may be recycled by the operating system when the program ends. Just like if you open too many computer programs, the memory will decrease. When you restart the computer, the memory will come back. However, the unsaved data in some of your programs will be gone http://wudikua123.iteye.com/b ...

    reply
    0
  • Cancelreply