so i have this line
float vc =dd[0].x;
then i debug to check what the value of vc is
dd[0].x ----> 65503.000
vc ----> -1.0737418e+008
why?
dd is an array of D3DXVECTOR4
why value is different?
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]
[background=rgb(250, 251, 252)]Debugging with debugger[/background]
[/font]
Are you stepping the code through with breakpoints? If the breakpoint is on the line [font=courier new,courier,monospace]float vc =dd[0].x;[/font] then the value you see for [font=courier new,courier,monospace]vc [/font]will be the value before the assignment (at leas in MS Visual C++).
Place a breakpoint after that line and see the values again.
EDIT: maybe in debug build, you should see vc = 0. so if you are in debug build, my post is off, I think.
Place a breakpoint after that line and see the values again.
EDIT: maybe in debug build, you should see vc = 0. so if you are in debug build, my post is off, I think.
I think your not stepping the debugger through that line. Make sure your break point is set on the next instruction after float vc =dd[0].x; The debugger can reflect random values in variables that are not initialized.
You can verify with
float vc = 0.0f;
vc = dd[0].x;;
vc should be zero instead of a different number if you place the breakpoint at vc = dd[0].x;
You can verify with
float vc = 0.0f;
vc = dd[0].x;;
vc should be zero instead of a different number if you place the breakpoint at vc = dd[0].x;
Are you stepping the code through with breakpoints? If the breakpoint is on the line [font=courier new,courier,monospace]float vc =dd[0].x;[/font] then the value you see for [font=courier new,courier,monospace]vc [/font]will be the value before the assignment (at leas in MS Visual C++).
Place a breakpoint after that line and see the values again.
EDIT: maybe in debug build, you should see vc = 0. so if you are in debug build, my post is off, I think.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement