1. µØÖ·£ºÔÚ¼ÆËã»úϵͳÖУ¬»á¶ÔÄÚ´æÖеÄÿһ¸ö×Ö½Ú½øÐбàºÅ£¬²ÉÓù̶¨³¤¶ÈµÄµÄÊ®Áù½øÖÆÊý¾Ý±íʾ£¬Ã¿Ò»¸ö±àºÅ¹Ì¶¨¶ÔÓ¦Ò»¸ö×Ö½Ú£¬±àºÅ³ÆΪµØÖ·£¬-----> Ö¸Õë
2. ·ÃÎÊÒ»¿éÄÚ´æ¿Õ¼ä·½Ê½
1£©Ö±½Ó·ÃÎÊ£ºÖ±½Óͨ¹ý¶Ô±äÁ¿Ãû½øÐжÁд²Ù×÷£¬´Ó¶ø´ïµ½¶Ô±äÁ¿ÃûËù¶ÔÓ¦µÄ¿Õ¼ä½øÐжÁд²Ù×÷
2£©¼ä½Ó·ÃÎÊ£ºÍ¨¹ý¶ÔµØÖ·½øÐвÙ×÷£¬´Ó¶ø¼ä½Ó´ïµ½¶ÔµØÖ·¶ÔÓ¦µÄ¿Õ¼ä½øÐжÁд²Ù×÷
3. Ö¸ÕëµÄ·ÖÀà;
1£©Ö¸Õë³£Á¿£ºÖ¸ÕëµÄÖ¸Ïò¹Ì¶¨²»¿É¸Ä±äµÄ£¬Ö¸ÏòÊÇÒ»¿é¹Ì¶¨µÄ¿Õ¼ä£¬Êdz£Á¿Öµ
º¯ÊýÃû£¨±íʾº¯ÊýµÄÈë¿ÚµØÖ·£©
2£©Ö¸Õë±äÁ¿£ºÊÇÒ»¸ö´æ´¢µØÖ·µÄ±äÁ¿£¬±¾ÖÊÊDZäÁ¿£¬¼ò³ÆΪָÕë
4. Ö¸ÕëµÄ¶¨Ò壺
Ö¸ÕëÀàÐÍ£º Êý¾ÝÀàÐÍ *
¶¨ÒåÖ¸Õë±äÁ¿£º
Ö¸ÕëÀàÐÍ ±äÁ¿Ãû
Êý¾ÝÀàÐÍ* ±äÁ¿Ãû
1£©Ö¸ÕëÀàÐ͵ıäÁ¿Ãûͨ³£³ÆΪָÕëÃû£¬·ûºÏ±êʶ·ûÃüÃû¹æÔò
2£©Êý¾ÝÀàÐÍ£º
±íʾָÕëÒªÖ¸ÏòµÄ¶ÔÏóµÄÀàÐÍ
ÔÚ¶¨ÒåµÄʱºò³öÏÖ * ,±íʾ¶¨ÒåµÄÊÇÖ¸Õë
#include <stdio.h>
int main() {
int a ; char b ; short d ; double f;
int k;
//´òÓ¡a¿Õ¼äµÄÊ×µØÖ· printf("%#p\n",&a); //0X0061FF28 printf("%#p\n",&k); //0X0061FF24 //´òÓ¡b¿Õ¼äµÄÊ×µØÖ· // printf("%#p\n",&b); //0X0061FF2B // printf("%#p\n",&d); //0X0061FF28 // printf("%#p\n",&f); //0X0061FF20
//µØÖ·ÀàÐÍ£º void * //0X0061FF28 void * //²»ÄÜÈ·¶¨ÐèÒªÒÔµ±Ç°µØַΪÊ×µØÖ·ÐèÒª¼¸¸ö×Ö½Ú
//¼ä½Ó·ÃÎÊ¿Õ¼ä //µØÖ··ÃÎʿռ䣬
//*((int *)0X0061FF28)= 899; //½«899дÈëÒÔ0X0061FF28ΪÊ×µØÖ·µÄÒ»¿éÁ¬µÄËÄ×Ö½Ú¿Õ¼äÀïÃæ //0X0061FF28 ÊÇa¿Õ¼äµÄÊ×µØÖ· //0X0061FF28 µØÖ·Ö¸Ïòa¿Õ¼ä int *pf = (int *)0X0061FF28; //pf Ö¸Ïòa¿Õ¼ä
*(pf) = 1899;
pf = (int *)0X0061FF24; //pfÖ¸Ïòk¿Õ¼ä *pf = 8212;
//*((char *)0X0061FF2B) = 'G'; //0X0061FF2B Ö¸Ïòb¿Õ¼ä
//*((short *)0X0061FF28) = 782; //0X0061FF28 Ö¸Ïòc¿Õ¼ä
//*((double *)0X0061FF20) = 862.244; //0X0061FF20 Ö¸Ïòf¿Õ¼ä
printf("%d\n",a); //899 printf("%d\n",k); // // printf("%c\n",b); //'G' // printf("%d\n",d); //782 // printf("%f\n",f); //862.244 return 0;
} |