How does Visual Studio decide on the field names in a C structure when doing a quick watch on the structure?

Theodore Sung 0 Reputation points
2025-02-18T22:47:49.76+00:00

Programming in C. I was curious how/where Visual Studio is determining the field names of a structure when one does a quick watch on the pointer to the structure's memory. The reason is a bit odd but here it is:

we have a client facing structure that is also used internally our API. Internally we want the field to be one name but to the client we want it to be another name. So we've been playing with redefining the field name in various header files but are curious how Visual Studio decides which field name to actually display in Quick Watch or the Watch Window.

Thanks, Ted

Developer technologies | C++
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,926 Reputation points Volunteer Moderator
    2025-02-20T16:48:21.6+00:00

    typedef's are scoped to the source using them. the debugger uses the symbol table generated for each source, to know what properties a typedef has in that source.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.