Reputation: 804
I use VC2010 and I see that the same data is represented differently while debugging and writing. for example : 37487840ca673239dc72f9eeb746947a is represented as
0x0022f844 "37487840ca673239dc72f9eeb746947a" unsigned char [33]
and
0x0022f670 "48598840ca673239dc72f9eeb746947a" unsigned char [33]
I want the first representation but the second one is written to files instead of the first one.
EDIT:
the first and the second values need to be same because the second one is just a copy of the first one. Actually I passed the first value as an argument to a function and the second value represents it before anything is done in this function.
Upvotes: 0
Views: 69
Reputation: 206729
The first part (0x...
) is the address of the variable you're watching. What follows is a printout of the contents of memory at that address.
The second variable/memory area you're watching is not "a representation of" 37487..., it contains a different value.
Upvotes: 1
Reputation: 754763
The value in the left hand column is the address of the array. Since the array is of a fixed size Visual Studio is displaying all of it's elements in the value column.
Here there are two different addresses and hence two different values are displayed.
Upvotes: 1
Reputation: 60024
0x0022f844 is an example of hexadecimal number. That's (by default) the format used to display addresses. So that value, that vary from run to run, it's the 'human understandable' representation of the address of the memory area where the value resides. It's useless to put it in a file. Store your value instead.
Upvotes: 1