Cר¼Ò±à³Ìѧϰ±Ê¼Ç(3)
µÚ8ÕÂ:ÔÙÂÛÊý×é
1.ʲôʱºòÊý×éºÍÖ¸ÕëÊÇÏàͬµÄ
CÓïÑÔ±ê×¢¶Ô´Ë×÷ÁËÈçÏÂ˵Ã÷:
¹æÔò1: ±í´ïʽÖеÄÊý×éÃû(ÓëÉùÃ÷²»Í¬)±»±àÒëÆ÷µ±×÷Ò»¸öÖ¸Ïò¸ÃÊý×éµÚÒ»¸öÔªËصÄÖ¸Õë.
int a[10], *p, i=2;
¿ÉÒÔͨ¹ýÒÔÏÂÈκÎÒ»ÖÖ·½·¨·ÃÎÊa[i];
p = a; p[i];
p = a; *(p+a);
p = a + i; *p
ÔÚ±í´ïʽÖÐ,Ö¸ÕëºÍÊý×éÊÇ¿ÉÒÔ»¥»»µÄ,ÒòΪËüÃÇÔÚ±àÒëÆ÷ÀïµÄ×îÖÕÐÎʽ¶¼ÊÇÖ¸Õë,²¢ÇÒ¶¼¿ÉÒÔ½øÐÐȡϱê²Ù×÷.
¹æÔò2: ϱê×ÜÊÇÓëÖ¸ÕëµÄÆ«ÒÆÁ¿Ïàͬ.
¹æÔò3: ÔÚº¯Êý²ÎÊýµÄÉùÃ÷ÖÐ,Êý×éÃû±»±àÒëÆ÷µ±×÷Ö¸Ïò¸ÃÊý×éµÚÒ»¸öÔªËصÄÖ¸Õë.
ÔÚº¯ÊýÐβζ¨ÒåÕâ¸öÌØÊâÇé¿öÏÂ,±àÒëÆ÷±ØÐë°ÑÊý×éÐÎʽ¸Äд³ÉÖ¸ÏòÊý×éµÚÒ»¸öÔªËصÄÖ¸ÕëÐÎʽ.±àÒëÆ÷Ö»Ïòº¯Êý´«µÝÊý×éµÄµØÖ·,¶ø²»ÊÇÕû¸öÊý×éµÄ¿½±´.Òò´ËÔÚmy_function()µÄµ÷ÓÃÉÏ,ÎÞÂÛʵ²ÎÊÇÊý×黹ÊÇÕæµÄÖ¸Õ붼ÊǺϷ¨µÄ.
my_function(int *turnip) { ... }
my_function(int turnip[]) { ... }
my_function(int turnip[200]) { ... }
Ïà¹ØÎĵµ£º
ÈÕÖ¾
·ÖÏí¸øºÃÓѸ´ÖÆÍøÖ·Òþ²ØÇ©Ãûµµ´ó×ÖÌå
ÉÏһƪ ÏÂһƪ ·µ»ØÈÕÖ¾Áбí
ÔÚ2000ºÍxpÏÂÈçºÎ½«cÅÌfat32ת»»³Éntfs
±à¼ | ɾ³ý | ȨÏÞÉèÖà | ¸ü¶à▼
¸ü¶à¡ø
ÉèÖÃÖö¥
ÍƼöÈÕÖ¾
תΪ˽ÃÜÈÕÖ¾
Bandit ·¢±íÓÚ2007Äê12ÔÂ12ÈÕ 09:12 ÔĶÁ(9) ÆÀÂÛ(0) ·ÖÀࣺ ¸öÈËÈÕ¼Ç È¨ÏÞ: ¹«¿ª
1¡¢µ½ÃüÁîÌá ......
1.3 µ¥Ôª²âÊÔÄܲúÉúÄÄЩЧÒ棿
µ¥Ôª²âÊÔµÄЧÒæÒѾµÃµ½¹ã·ºµÄÈÏͬ£¬ÏÖÔÚµÄÎÊÌâÒѾ²»ÊÇÓÐûÓбØÒª×ö£¬Öµ²»ÖµµÃ×ö£¬¶øÊÇÈçºÎ¶à¿ìºÃÊ¡µØ×öºÃµ¥Ôª²âÊÔ£¬ËùÒÔ£¬¹ØÓÚЧÒ棬ÕâÀïÖ»ÊǼòµ¥µÄ½éÉÜһϡ£
ЧÒæÒ»£¬±£Ö¤´úÂëÖÊÁ¿
Ö»Óе¥Ôª²âÊÔ²ÅÄÜÍêÕû¼ì²â´úÂëµ¥ÔªµÄ¹¦Ä ......
extern "C"
Ŀ¼
¸ÅÊö ±àÒ뷽ʽ Ï°¹ßÓ÷¨
¸ÅÊö
¡¡¡¡extern "C" °üº¬Ë«Öغ¬Ò壬´Ó×ÖÃæÉϼ´¿ÉµÃµ½£ºÊ×ÏÈ£¬±»ËüÐÞÊεÄÄ¿±êÊÇ“extern”µÄ£»Æä´Î£¬±»ËüÐÞÊεÄÄ¿±êÊÇ“C”µÄ¡£ÈÃÎÒÃÇÀ´Ïêϸ½â¶ÁÕâÁ½Öغ¬Òå¡£
¡¡¡¡£¨1£© ±»extern "C"ÏÞ¶¨µÄº¯Êý»ò±äÁ¿ÊÇexternÀàÐ͵Ä
¡¡¡¡externÊÇC/C++ÓïÑÔÖбíÃ÷º¯Ê ......
CPU : ARM9 s3c2410
LCD : ¹æ¸ñ²»Ã÷£¨Õâ¸öºÜÎÞÄΣ¬µ«ÊÇÎÒËùÖªµÀµÄÖ»ÓÐÒ»¸ö·Ö±æÂÊ£©
Ô´ÂëÐ޸ģº
/linux-2.6.30.4/arch/arm/mach-s3c2410/mach-smdk2410.c
ÔÚÕâ¸öÎļþÖмÓÈëframebufferµÄ³õʼ»¯Êý¾Ý½á¹¹£¨¾ßÌåÊý¾Ý²ÎÕÕLCD¼¼ÊõÊֲᣩÈçÏ£º
#include <mach/fb.h> ......
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
int flag=0; // ......