全局数组的Visual Studio C ++监视列表 [英] Visual Studio C++ watch list for global arrays

查看:159
本文介绍了全局数组的Visual Studio C ++监视列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全局数组无法在简单的表单项目中正确显示.我可以将局部变量设置为等于全局数组的元素,并且值是正确的.标量变量正确显示.

有任何想法吗?我正在使用Visual Studio2010.

Global arrays do not display properly in a simple forms project. I can set local variables equal to elements of the global array and the values are correct. Scalar variables display properly.

Any ideas? I am using Visual Studio 2010.

//GlobalTest.cpp : main project file.

#include "stdafx.h"
#include "Form1.h"

using namespace GlobalTest;

double XX[7] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
double ZZ = 3;

[STAThreadAttribute]
int main(array<System::String ^> ^args)
{

    double YY[7];

    for(int i=0; i<7; i++)
    {
        YY[i] = XX[i];
    }

    // Enabling Windows XP visual effects before any controls are created
    Application::EnableVisualStyles();
    Application::SetCompatibleTextRenderingDefault(false);

    // Create the main window and run it
    Application::Run(gcnew Form1());
    return 0;
}

推荐答案

从来没有这个问题.您确定程序其他地方没有内存错误吗?我曾经接管过一个编写得很差的程序,如果由于大量内存错误而更改了变量名,该程序就会崩溃.
Never had this problem. Are you sure that you do not have a memory error somewhere else in your program? I once took over a program that was written so poorly that the program would break if you changed variable names due to extensive memory errors.


这篇关于全局数组的Visual Studio C ++监视列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆