c (Compare Memory)
The c command compares the values held in two memory areas.
c Range Address
Parameters
Range
The first of the two memory ranges to be compared. For more syntax details, see Address and Address Range Syntax.
Address
The starting address of the second memory range to be compared. The size of this range will be the same as that specified for the first range. For more syntax details, see Address and Address Range Syntax.
Environment
Item | Description |
---|---|
Modes | User mode, kernel mode |
Targets | Live, crash dump |
Platforms | All |
Additional Information
For an overview of memory manipulation and a description of other memory-related commands, see Reading and Writing Memory.
Remarks
If the two areas are not identical, the debugger will display all memory addresses in the first range where they do not agree.
As an example, consider the following code:
void main()
{
char rgBuf1[100];
char rgBuf2[100];
memset(rgBuf1, 0xCC, sizeof(rgBuf1));
memset(rgBuf2, 0xCC, sizeof(rgBuf2));
rgBuf1[42] = 0xFF;
}
To compare rgBuf1 and rgBuf2, use either of the following commands:
0:000> c rgBuf1 (rgBuf1+0n100) rgBuf2
0:000> c rgBuf1 L 0n100 rgBuf2