小编rnd*_*809的帖子

作者在用C++解释堆栈和堆时是错误的还是我误读了什么?

这是代码:

int main()
{
    using namespace std; 
    int nights = 1001; 
    int * pt = new int; // allocate space for an int
    *pt = 1001;         // store a value there

    cout << "nights value = ";
    cout << nights << ": location " << &nights << endl;
    cout << "int ";
    cout << "value = " << *pt << ": location = " << pt << endl;

    double * pd = new double; // allocate space for a double …
Run Code Online (Sandbox Code Playgroud)

c++ c++11

54
推荐指数
5
解决办法
6406
查看次数

标签 统计

c++ ×1

c++11 ×1