When should I use the new keyword in C++?

前端 未结 11 976
甜味超标
甜味超标 2020-11-22 05:47

I\'ve been using C++ for a short while, and I\'ve been wondering about the new keyword. Simply, should I be using it, or not?

1) With the new keywo

11条回答
  •  余生分开走
    2020-11-22 06:26

    Without the new keyword you're storing that on call stack. Storing excessively large variables on stack will lead to stack overflow.

提交回复
热议问题