C和C++中未定义,未指定和实现定义的行为有什么区别?
c c++ undefined-behavior unspecified-behavior implementation-defined-behavior
我已经搜索过了,但我对这三个概念并不是很了解.我何时必须使用动态分配(在堆中)以及它的真正优势是什么?静态和堆栈有什么问题?我可以编写整个应用程序而无需在堆中分配变量吗?
我听说其他语言包含了"垃圾收集器",所以你不必担心内存.垃圾收集器做什么?
您可以自己操作内存,而不能使用此垃圾收集器吗?
有人告诉我这个声明:
int * asafe=new int;
Run Code Online (Sandbox Code Playgroud)
我有一个"指针指针".这是什么意思?它不同于:
asafe=new int;
Run Code Online (Sandbox Code Playgroud)
?