Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

cÖ¸ÕëÏê½â

 µÚÒ»Õ ¸ÅÄî
Ö¸ÕëÊÇÒ»¸öÌØÊâµÄ±äÁ¿£¬ËüÀïÃæ´æ´¢µÄÊýÖµ±»½âÊͳÉΪÄÚ´æÀïµÄÒ»¸öµØÖ·¡£Òª¸ãÇåÒ»¸öÖ¸ÕëÐèÒª¸ãÇåÖ¸ÕëµÄËÄ·½ÃæµÄÄÚÈÝ£ºÖ¸ÕëµÄÀàÐÍ£¬Ö¸ÕëËùÖ¸ÏòµÄÀàÐÍ£¬Ö¸ÕëµÄÖµ»òÕß½ÐÖ¸ÕëËùÖ¸ÏòµÄÄÚ´æÇø£¬»¹ÓÐÖ¸Õë±¾ÉíËùÕ¼¾ÝµÄÄÚ´æÇø¡£ÈÃÎÒÃÇ·Ö±ð˵Ã÷¡£
ÏÈÉùÃ÷¼¸¸öÖ¸Õë·Å×Å×öÀý×Ó£º
ÀýÒ»£º
(1)int *ptr;
(2)char *ptr;
(3)int **ptr;
(4)int (*ptr)[3];
(5)int *(*ptr)[4];
Èç¹û¿´²»¶®ºó¼¸¸öÀý×ӵĻ°£¬Çë²ÎÔÄÎÒÇ°¶Îʱ¼äÌù³öµÄÎÄÕ < <ÈçºÎÀí½âcºÍc
++µÄ¸´ÔÓÀàÐÍÉùÃ÷>>¡£
¡¡
1 Ö¸ÕëµÄÀàÐÍ¡£
´ÓÓï·¨µÄ½Ç¶È¿´£¬ÄãÖ»Òª°ÑÖ¸ÕëÉùÃ÷Óï¾äÀïµÄÖ¸ÕëÃû×ÖÈ¥µô£¬Ê£ÏµIJ¿·Ö¾ÍÊÇÕâ¸öÖ¸ÕëµÄÀàÐÍ¡£ÕâÊÇÖ¸Õë±¾ÉíËù¾ßÓеÄÀàÐÍ¡£ÈÃÎÒÃÇ¿´¿´ÀýÒ»Öи÷¸öÖ¸ÕëµÄÀàÐÍ£º
(1)int *ptr; //Ö¸ÕëµÄÀàÐÍÊÇint *
(2)char *ptr; //Ö¸ÕëµÄÀàÐÍÊÇchar *
(3)int **ptr; //Ö¸ÕëµÄÀàÐÍÊÇ int **
(4)int (*ptr)[3]; //Ö¸ÕëµÄÀàÐÍÊÇ int(*)[3]
(5)int *(*ptr)[4]; //Ö¸ÕëµÄÀàÐÍÊÇ int *(*)[4]
ÔõôÑù£¿ÕÒ³öÖ¸ÕëµÄÀàÐ͵ķ½·¨ÊDz»ÊǺܼòµ¥£¿
¡¡
2 Ö¸ÕëËùÖ¸ÏòµÄÀàÐÍ¡£
µ±Äãͨ¹ýÖ¸ÕëÀ´·ÃÎÊÖ¸ÕëËùÖ¸ÏòµÄÄÚ´æÇøʱ£¬Ö¸ÕëËùÖ¸ÏòµÄÀàÐ;ö¶¨Á˱àÒëÆ÷½«°ÑÄÇƬÄÚ´æÇøÀïµÄÄÚÈݵ±×öʲôÀ´¿´´ý¡£
´ÓÓï·¨ÉÏ¿´£¬ÄãÖ»Ðë°ÑÖ¸ÕëÉùÃ÷Óï¾äÖеÄÖ¸ÕëÃû×ÖºÍÃû×Ö×ó±ßµÄÖ¸ÕëÉùÃ÷·û*È¥µô£¬Ê£ÏµľÍÊÇÖ¸ÕëËùÖ¸ÏòµÄÀàÐÍ¡£ÀýÈ磺
(1)int *ptr; //Ö¸ÕëËùÖ¸ÏòµÄÀàÐÍÊÇint
(2)char *ptr; //Ö¸ÕëËùÖ¸ÏòµÄµÄÀàÐÍÊÇchar
(3)int **ptr; //Ö¸ÕëËùÖ¸ÏòµÄµÄÀàÐÍÊÇ int *
(4)int (*ptr)[3]; //Ö¸ÕëËùÖ¸ÏòµÄµÄÀàÐÍÊÇ int()[3]
(5)int *(*ptr)[4]; //Ö¸ÕëËùÖ¸ÏòµÄµÄÀàÐÍÊÇ int *()[4]
ÔÚÖ¸ÕëµÄËãÊõÔËËãÖУ¬Ö¸ÕëËùÖ¸ÏòµÄÀàÐÍÓкܴóµÄ×÷Óá£
Ö¸ÕëµÄÀàÐÍ(¼´Ö¸Õë±¾ÉíµÄÀàÐÍ)ºÍÖ¸ÕëËùÖ¸ÏòµÄÀàÐÍÊÇÁ½¸ö¸ÅÄî¡£µ±Äã¶ÔCÔ½À´Ô½ÊìϤʱ£¬Äã»á·¢ÏÖ£¬°ÑÓëÖ¸Õë½ÁºÍÔÚÒ»ÆðµÄ“ÀàÐÍ”Õâ¸ö¸ÅÄî·Ö³É“Ö¸ÕëµÄÀàÐÍ”ºÍ“Ö¸ÕëËùÖ¸ÏòµÄÀàÐÍ”Á½¸ö¸ÅÄÊǾ«Í¨Ö¸ÕëµÄ¹Ø¼üµãÖ®Ò»¡£ÎÒ¿´Á˲»ÉÙÊ飬·¢ÏÖÓÐЩдµÃ²îµÄÊéÖУ¬¾Í°ÑÖ¸ÕëµÄÕâÁ½¸ö¸ÅÄî½ÁÔÚÒ»ÆðÁË£¬ËùÒÔ¿´ÆðÊéÀ´Ç°ºóì¶Ü£¬Ô½¿´Ô½ºýÍ¿¡£
3 Ö¸ÕëµÄÖµ£¬»òÕß½ÐÖ¸ÕëËùÖ¸ÏòµÄÄÚ´æÇø»òµØÖ·¡£
Ö¸ÕëµÄÖµÊÇÖ¸Õë±¾Éí´æ´¢µÄÊýÖµ£¬Õâ¸öÖµ½«±»±àÒëÆ÷µ±×÷Ò»¸öµØÖ·£¬¶ø²»ÊÇÒ»¸öÒ»°ãµÄÊýÖµ¡£ÔÚ32λ³ÌÐòÀËùÓÐÀàÐ͵ÄÖ¸ÕëµÄÖµ¶¼ÊÇÒ»¸ö32λÕûÊý£¬ÒòΪ32λ³ÌÐòÀïÄÚ´æµØÖ·È«¶¼ÊÇ32볤¡£
Ö¸ÕëËùÖ¸ÏòµÄÄÚ´æÇø¾ÍÊÇ´ÓÖ¸Õë


Ïà¹ØÎĵµ£º

C/C++Öеİ´Öµµ÷ÓÃÓë°´ÒýÓõ÷ÓÃ

 Ðí¶à±à³ÌÓïÑÔÖеĵ÷Óú¯ÊýµÄÁ½ÖÖ·½·¨ÊÇ°´Öµµ÷ÓÃ(call-by-value)ºÍ°´ÒýÓõ÷ÓÃ(call-by-reference)¡£
²ÎÊý°´Öµµ÷Óô«µÝʱ£¬Éú³É²ÎÊýÖµ¸±±¾²¢ÇÒ´«¸ø±»µ÷Óú¯Êý£¬¸±±¾µÄ¸Ä±ä²¢²»Ó°Ïìµ÷ÓÃÕßµÄԭʼ±äÁ¿Öµ£¬ÕâÑù¾Í¿ÉÒÔ·ÀÖ¹ÒâÍâµÄ¸±×÷ÓÃÓ°Ï쿪·¢ÕýÈ·£¬¿É¿¿µÄϵͳ¡£°´Öµµ÷ÓõÄÒ»¸öȱµãÊÇ£¬Èç¹û´«µÝ½Ï´óµÄÊý¾ÝÏÔò¸´ÖÆÕâ¸öÊý ......

ÑòÈÞ±»ÓþΪ¡°Èí½ð×Ó¡±Ò²³ÉB¶þCµÄÍØ»ÄÕß

ÑòÈÞ±»ÊÇÒÔɽÑòÈÞΪԭ²ÄÁÏÕëÖ¯Îï¶ø³ÉµÄ´²ÉÏÓÃÆ·,ÒÀ¾ÝÉ´ÏßÖÖÀà·Ö³É´Ö·Ä֯ƷºÍ¾«·ÄÕëÖ¯ÎïÁ½ÖÖ,ÒÀ¾ÝÔ­²ÄÁϱÈÖµ¿ÉÒԷֳɴ¿ÑòÈÞ¼°ÑòÈÞ»ì·ÄÁ½ÖÖ¾­¼Ó¹¤¶ø³ÉµÄÉú»îÓÃÆ·£¬¹©Å¯ÐԺ㬸Ç×ÅÊæ̹£¬¾¡ÏԸߵµ¾×½À¡£ ±¾ÎÄÀ´Ô´£º¸ÊËàÇìÑôÌÚ´ïÉÌó ......

C/C++ style

 #include <stdio.h>
int main()
{
char *str[] = {"welcome", "to", "fortemedia", "nanjing"};
char **p = str + 1;
str[0] = ( *p++ ) + 2;
str[1] = * ( p + 1 );
str[2] = p[1] + 3;
str[3] = p[0] + ( str[2] - str[1] );
printf ( "%s\n", str[0] );
printf ( ......

C/C++——С±à̸CÓïÑÔº¯ÊýÄÇЩÊÂ(23)

C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæС±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
 
1.   settextstyleº¯Êý
settextstyleº¯ÊýµÄ¹¦ÄÜÊÇΪͼÐÎÊä³öÉèÖõ±Ç°µÄÎı¾ÊôÐÔ£¬ÆäÓ÷¨Îª£ºvoid far settextstyle (int font, int direction, char size);³ ......

C/C++——С±à̸CÓïÑÔº¯ÊýÄÇЩÊÂ(24)

C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæС±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
 
1.   setvectº¯Êý
setvectº¯ÊýµÄ¹¦ÄÜÊÇÉèÖÃÖжÏʸÁ¿Èë¿Ú£¬ÆäÓ÷¨Îª£ºvoid setvect(int intr_num, void interrupt(*isr)());³ÌÐòʵÀýÈçÏ£º
#include <st ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ