How to deallocate variables on the stack?

前端 未结 6 1832
一向
一向 2021-01-29 14:15

Is there a way to deallocate variables and/or objects created on the stack? I am specifically talking about the stack not the heap.

I do not want to debate whether this

6条回答
  •  逝去的感伤
    2021-01-29 14:57

    {
      int a;
    } // 'a' "deallocated" here
    

    You can't get rid of a before the end of the enclosing scope.

提交回复
热议问题