开发者

Visual Studio 2010 Watch Window?

I am working on a C++ code, and this is w开发者_JS百科hat I have in Visual Studio 2010 watch window:

Visual Studio 2010 Watch Window?

I just need to understand what it means when File_Service is in [] and how to access it in my code. When I add it to the watch window, Visual studio adds it like this: {,,Simulator.exe}*(File_Service*){*}exe Any Help would be appreciated.


The square brackets in this case mean that the dynamic type of variable exe is File_Service. That is, your exe variable, of type unknown to me, is pointing on an object of type File_Service. Assuming exe is of type Executable, which File_Service inherits from, under that [File_Service] you'll find the variables that have been defined in File_Service.

When adding the expression in the square brackets as a member to watch, you're basically instructing the debugger to cast exe into a File_Service. This is fine in this case, but if exe will point on a different kind of Executable, that weird-looking expression won't show you anything (you can't downcast an Executable object, say, to a File_Service).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜