【问题标题】:How to view global variables while debugging调试时如何查看全局变量
【发布时间】:2019-05-09 22:37:00
【问题描述】:

如何在 Visual Studio Code 中查看全局指针变量 root?

示例如下:

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include "pch.h"
#include <iostream>

struct node
{
    int data;
    struct node *link;
};

struct node *root;

【问题讨论】:

  • 加个手表就可以了?

标签: c++ debugging visual-studio-code


【解决方案1】:

进入调试模式(F5)

将变量添加到观看(右键单击 *root - 添加到观看)

调试执行期间值将显示在监视窗口中

【讨论】:

    猜你喜欢
    • 2021-02-24
    • 2019-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-16
    相关资源
    最近更新 更多