Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6473063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:25:17+00:00 2026-05-25T06:25:17+00:00

I’m having a really bizarre problem wherein the watch window values for some variables

  • 0

I’m having a really bizarre problem wherein the watch window values for some variables don’t seem to match their “real world” values. The debugger just appears to be off in space. Here’s the tiniest code snippet that shows it:

printf("%d", pNodes[nNode].nColumn); // watch shows "4"
printf("%d", nColumn); // watch shows "1"

if (pNodes[nNode].nColumn != nColumn)
  continue; // this is NOT called

So here’s the behaviour:

  1. If I add a watch to pNodes[nNode].nColumn, it shows a value of 4.
  2. If I add a watch to nColumn, it shows a value of 1.
  3. If I check the expression pNodes[nNode].nColumn != nColumn in the watch window, it evaluates to true.
  4. The continue statement is skipped!
  5. I added the printf() calls to see what was going on, and the printf() prints the values 1 and 1, which seems to agree with the way the code “flows” (i.e. that it does not call the continue inside the if statement.

I can even check the memory at &pNodes(nNode].nColumn, and the memory shows the “incorrect” values that the watch window is showing me. So it seems like the debugger is getting completely “disconnected” from the actual program data or something. I’m running a debug build optimizations are turned off. I’ve also checked that pNodes does not correspond to some global variable or other variable higher in scope — it seems there’s only a local version.

This is completely baffling to me! I’m not even sure where to go next to try to figure out the problem. If you have any ideas whatsoever, I’d love to hear them!

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:25:18+00:00Added an answer on May 25, 2026 at 6:25 am

    So I think I’ve cracked the case: The culprit was Struct Member Alignment. I had a bunch of projects mixed together and some of them had varying values for this field inside the projects. I removed the settings on all of them to just let VS pick the defaults and the problem has disappeared.

    The applicable value was between 4 bytes in some of the projects, Default in some of the projects, and empty altogether in others. The value is under Configuration Properties/ C/C++ / Code Generation / Struct Member Alignment. Again, I ended up just deleting the values altogether for the projects. I think this was set on the projects at some point in the past to deal with some kind of cross-platform issue, but at least it’s fixed for the work I’m doing now!

    Thanks for all of your help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have some data like this: 1 2 3 4 5 9 2 6

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.