Ö¸Õë±äÁ¿µÄ¶¨ÒåºÍ³õʼ»¯[c][code]
ÔÌû£º
http://hi.baidu.com/pepsi360/blog/item/cc74be4412cf6789b3b7dcd4.html
#include <stdio.h>
struct Node
{
int a;
char b[10];
Node *next;
};
main(void)
{
char *p=NULL; //"define NULL 0" included in <stdio.h>
int *q=0; //Öµ0ÊÇΨһÄܹ»Ö±½Ó¸³¸øÖ¸Õë±äÁ¿µÄÕûÊýÖµ
double *d;
Node *pNode=NULL;
d=NULL;
return 0;
}
ÒÔÉÏ´úÂëÔÚVC»·¾³Ïµ÷ÊÔÔËÐС£
step1. ÔËÐÐÍêÓï¾äNode *pNode=NULL;ºó£º
Name Value
+ &p 0x0012ff7c ""
+ &q 0x0012ff78 ""
+ &d 0x0012ff74 ""
+ &pNode 0x0012ff70 ""
Memory:
0012FF66 CC CC CC CC CC CC CC CC CC CC 00 ÌÌÌÌÌÌÌÌÌÌ.
0012FF71 00 00 00 CC CC CC CC 00 00 00 00 ...ÌÌÌÌ....
0012FF7C 00 00 00 00 C0 FF 12 00 39 11 40 ........9.@
step2. ÔËÐÐÍêÓï¾äd=NULL;ºó£º
Name Value
+ &p 0x0012ff7c ""
+ &q 0x0012ff78 ""
+ &d 0x0012ff74 ""
+ &pNode 0x0012ff70 ""
Memory:
0012FF66 CC CC CC CC CC CC CC CC CC CC 00 ÌÌÌÌÌÌÌÌÌÌ.
0012FF71 00 00 00 00 00 00 00 00 00 00 00 ...ÌÌÌÌ....
0012FF7C 00 00 00 00 C0 FF 12 00 39 11 40 ........9.@
ÔÚTurbo CÖеĴúÂëÈçÏ£º
#include <stdio.h>
struct Node
{
int a;
char b[10];
struct Node *next; /* struct²»ÄÜÉÙ */
};
main(void)
{
char *p=NULL; /* "define NULL 0" included in <stdio.h> */
int *q=0;
&
Ïà¹ØÎĵµ£º
linuxÊÇÒ»¸ö¸´ÔÓµÄÈí¼þϵͳ£¬ÆäÄÚºËÔ´´úÂëÍùÍù»áÓõ½Ò»Ð©ÔÚÓ¦ÓóÌÐòÉè¼ÆÖв¿³£¼ûÓïÑԳɷֺͱà³Ì¼¼ÇÉ£¬ÕâЩ¶¼ÊÇ·ÖÎöÄÚºËÔ´´úÂëµÄ»ù±¾¹¦£¬Ï£Íû´ó¼ÒÄÜÖصãÕÆÎÕ¡£
Ê×ÏÈ£¬gcc±àÒëÆ÷´ÓÓïÑÔÀïÎüÊÕÁË“inline”ºÍ“const”¡£inlineº¯ÊýµÄ´óÁ¿Ê¹Óã¬ÓÐÀûÓÚÌá¸ßÔËÐ ......
C×Ö·û´®´¦Àíº¯ÊýµÄʵÏÖ£¨Linux£©
#include <stddef.h>
char * ___strtok = NULL;
char * strcpy(char * dest,const char *src)
{
char *tmp = dest;
while ((*dest++ = *src++) != '\0')
/* nothing */;
return tmp;
}
char * strncpy(char * dest,const char *src,size_t count)
{
char *tmp = d ......
ÄÚÈݽéÉÜ
±¾ÏµÁÐÎÄÕ¸ù¾Ý¡¶µ¥Ôª²âÊÔÓëVU2.6Ó¦Óá·ÊÓƵ½²×ùµÄÀíÂÛ²¿·ÖÕûÀí¶ø³É£¬Ö÷ÒªÌÖÂÛËĸöÎÊÌ⣺ΪʲôÐèÒªµ¥Ôª²âÊÔ£¿ÔõÑùÕ÷·þ¿É²âÐÔÄÑÌ⣿ÔõÑù²ÅÄܸßЧÂʲâÊÔ£¿ÔõÑù±£Ö¤²âÊÔЧ¹û£¿Öصã²ûÊöµ¥Ôª²âÊԵĹؼüÎÊÌ⣬²»ÊÇÒ»°ã¸ÅÄÊʺÏÓÚ¶Ôµ¥Ôª²âÊÔÓÐÒ»¶¨Á˽âµÄ¶ÁÕß¡£
ÔÚÑ¡Ôñ¹¤¾ßºÍʵʩ ......
1£® ÔÚCÓïÑÔÖÐÄÚǶ»ã±à
ÔÚCÖÐÄÚǶµÄ»ã±àÖ¸Áî°üº¬´ó²¿·ÖµÄARMºÍThumbÖ¸Á²»¹ýÆäʹÓÃÓë»ã±àÎļþÖеÄÖ¸ÁîÓÐЩ²»Í¬£¬´æÔÚһЩÏÞÖÆ£¬Ö÷ÒªÓÐÏÂÃ漸¸ö·½Ã棺
a. ²»ÄÜÖ±½ÓÏòPC¼Ä´æÆ÷¸³Öµ£¬³ÌÐòÌøתҪʹÓÃB»òÕßBLÖ¸Áî
b. ÔÚʹÓÃÎïÀí¼Ä´æÆ÷ʱ£¬²»ÒªÊ¹ÓùýÓÚ¸´ÔÓµÄC±í´ïʽ£¬±ÜÃâÎïÀí¼Ä´æÆ÷³åÍ»
c. R12ºÍR13¿ÉÄܱ»±àÒë ......
ÎÒ¾õµÃ,ÔÚÊäÈëÊä³öº¯ÊýÖÐ,scanf()º¯Êý,Ó¦¸ÃÊÇ×îÂé·³µÄ,ÓÐʱËü¸øÎÒÃǵĽá¹ûºÜ¿ÉЦ,µ«ÊÇÒ»¶¨ÊÇÒ»ÔÒòµÄ....
Ê×ÏÈÉùÃ÷Ò»ÏÂ,ÕâƪÈÕÖ¾²»ÊǽéÉÜscanf()Öи÷ÖÖ¸ñʽ·ûÓ÷¨µÄÎÄÕÂ(ûÓÐÕâ¸ö±ØÒª,µ«ÊÇ´ó¼ÒÒ»¶¨Òª»áÓÃ).
ÎÒ³¢ÊÔÁ˺ܶàÖÖÊäÈë,°üÀ¨Ò»Ð©´íÎóµÄÁ·Ï°,Ôø¾¶Ôscanf()ÓÉÃÔãתÏòÇåÐÑ,ÓÖÓÉÇåÐÑÔÙ´ÎתÏòÃÔã......²»ÖªµÀºÎʱÊǸö ......