显示/可视化数组和变量内容 [英] Display/visualize arrays and variables contents

查看:52
本文介绍了显示/可视化数组和变量内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们!

我需要知道程序运行后存储在变量和数组中的最后一个值(希望成功).
Matlab通过其工作区来实现.
如何在Visual Studio C ++ 2010中做到这一点?
相信我,我试图通过选项菜单找到一种方法,但是到目前为止,仍然没有成功.
谢谢.

Hi, guys!

I need to know the last values stored in variables and arrays after the program has run (successfully, I hope).
Matlab does it by ways of its Workspace.
How can I do that in Visual Studio C++ 2010?
Believe me, I''ve tried to find a way through the option menues, but, so far, no success.
THANKS IN ADVANCE.

推荐答案

这完全取决于要监视的变量的范围.

如果变量的范围遍及整个程序,则可以在程序退出前打印它们的值

如果它们是本地的,则可以在它们超出范围之前将它们打印出来.

您也可以使用VS调试模式(F5)逐步监视程序.
It all depends on the scope of the variables you are monitoring.

If the scope of the variables is through out the program you can print their values just before the program exits

If they are local, then you can print them just before they go out of scope.

Also you can use VS debug mode (F5) to monitor your program step by step.


这篇关于显示/可视化数组和变量内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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