Memory address and Pointer
- From: erfan <zhaoerfan@xxxxxxxxx>
- Date: Thu, 29 Nov 2007 21:55:33 -0800 (PST)
vc++6.0,winxp.
I use this code to see the memory address and the real value`s
address below:
#include<stdio.h>
int main()
{
int a=22;
int *p;
int i;
p=&a;
printf("%x\n",&a);
printf("%p\n",*p);
}
the result is:
12ff7c
00000016
Press any key to continue
the pointer p is pointing to a value which is 22,and the address of
the value is 0012ff7c.
i want to compare the memory address with the value address to see
wheather they are the same.
So ,next,i use win Debug to help me.
-d 0012:ff7c
but the output is 00 00 00 00 00 00 00 00 00......
what`s wrong? as far as i know,the value of a,must have it`s address
in the memory,and when i search the address,why there is nothing left
in it. there must be some mistake in my understanding,i really expect
your words~~
.
- Follow-Ups:
- Re: Memory address and Pointer
- From: Mark McIntyre
- Re: Memory address and Pointer
- From: Keith Thompson
- Re: Memory address and Pointer
- From: santosh
- Re: Memory address and Pointer
- From: Martin Ambuhl
- Re: Memory address and Pointer
- Prev by Date: Re: Reading a table
- Next by Date: Re: main function
- Previous by thread: Look Is On For Pattern Designing Software
- Next by thread: Re: Memory address and Pointer
- Index(es):
Relevant Pages
|