开发者

Examine C structure in Visual C

开发者 https://www.devze.com 2023-04-13 03:07 出处:网络
I\'m using a structure within a structure like this in VS2010 (simplified:) struct s_ptx { char xyz[33];

I'm using a structure within a structure like this in VS2010 (simplified:)

struct s_ptx
{
    char xyz[33];
    int newCount;
} ptx;

struct s_stream
{
    struct ptx[20];
    int count;
} Stream[20];

Everything is hunky dory until I try to examine this structure in the debugger: eg, if I try to "watch" Stream[0].ptx[3].xyz, it gives some cryptic message ("CXX0058 Error: overloaded operator not found.")

I did a lot of searching on the Web, and found this is not an uncommon problem, and that the only way to examine these sorts of structures is through adding a complex bit of code to the autoexp.dat file.

It would be one thing if it were C code that the autoexp.dat file required but, alas, it is something else, and it would be very time-consuming to learn this new language just to do what I want to do.

So, my question:

  • does anyone know of a way to examine these sorts of structs in the VS debugger natively

  • does anyone know of some code that I could copy into my autoexp.dat to do the job

    开发者_如何学编程
  • is anyone interested in writing this code as a service to me and all of mankind?


struct s_stream
{
    struct ptx[20];  // **what is this ???**
    int count;
} Stream[20];

i think 2nd structure should be like this

struct s_stream
{
    struct s_ptx  temp[20];
    int count;
} Stream[20];

this code workd fine in my gcc

#include <stdio.h>
struct s_ptx
{
    char xyz[33];
    int newCount;
} ptx;

struct s_stream
{
    struct s_ptx  temp[20];
    int count;
} Stream[20];

main()
{
 printf("this works fine %s",Stream[0].temp[3].xyz);


}
0

精彩评论

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