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

CÖ¸Õ루1£©

CÓïÑÔ±ØÖª±Ø»á
Ö¸Õ룺
1.Ö¸ÕëÉùÃ÷ºóÒª¸³Öµ£¡·ñÔòÊÇ¿ÕÖ¸Õ룬¿É²»ÖªµÀÖ¸ÏòÁËÄÄÀï
ÀýÈ磺
void swap(int *a,int *b){
    int *tmp;
    *tmp=*a;
    *a=*b;
    *b=*tmp;
}
±¾À´ÊÇÏëÀûÓÃÉÏÃæµÄswapº¯ÊýʵÏÖÁ½¸öÊýµÄ»¥»»£¬µ«ÊÇ*tep=*a;Õâ¾ä»°ÊÇÓÐÎóµÄ£¬ÒòΪָÕëtmpûÓб»¸³Öµ£¡ÊÇÓÃgcc±àÒëʱ²»»á³ö´í£¬µ«ÊÇÔËÐÐʱ»á³öÏֶϴíÎó£¡
2.Êý×éÓëÖ¸Õë
    ÕâÀïÓÐÁ½¸öºÜÈÝÒ×»ìÏýµÄ¸ÅÄÊý×éÖ¸ÕëºÍÖ¸ÕëÊý×é
Ö¸ÕëÖдæ·ÅµÄÊǵØÖ·£¬ËùÒԼȿÉÒÔÖ¸ÏòһάÊý×飬Ҳ¿ÉÒÔÖ¸Ïò¶àάÊý×飬ÏÂÃæÊǼòµ¥µÄÖ¸ÕëºÍÊý×éµÄÀý×Ó¡£
Àý1£º
int data[4];
int *p=data;»òint *p;p=data;
---------------------------------------------------
int data[2][3];
int *p=data;
int i=0;
while(i<2*3){
    scanf("%d",&p[i++]);
}
i=0;
while(i<2*3){
    printf("%d\t",p[i++]);
}
printf("\n");
ÊÇÓÃgcc±àÒëʱ»á²úÉú¾¯¸æ£º´Ó²»¼æÈݵÄÖ¸ÕëÀàÐͳõʼ»¯
    Êý×éÖ¸Õ룬ÕâÀï˵µÄÊý×éÖ¸Õë¼´Ö¸ÏòÊý×éµÄÖ¸Õ룬ÕâÓÐʲôºÍÉÏÃæµÄ²»Í¬ÄØ£¿ÊÇÓÃÏÂÃæÕâÖÖÊý×éÖ¸Õë¾ÍÊÇgccÏëÒªµÄ£¬ËùÒÔ²»»áÔÙ²úÉú¾¯¸æÁË¡£
Àý2£ºÓÃÊý×éÖ¸ÕëÖ¸Ïò¶þάÊý×é
int data[2][3]={1,2,3,4,5,6};
int (*pd)[3]=data;»òint (*pd)[3];pd=data;
int i=0,j=0;
while(i<2){
    while(j<3){
        printf("%d\t",*(*(pd+i)+j++));
    }
    i++;
    j=0;
    printf("\n");
}
//(*pd)[3]±íʾָÕëpdÖ¸ÏòµÄÊÇһάÊý×飬Õâ¸öÊý×éÊÇintµÄ£¬¶øÇÒº¬ÓÐÈý¸öÔªËØ¡£»¹ÓжþάÊý×é±ØÐëÃ÷È·Ö¸¶¨ÁеĴóС£¬ÕâµãºÜÈÝÒ×Àí½â£¬ÀýÈçÉÏÃæ¿ÉÒÔд³É
int data[][3]={1,2,3,4,5,6};
¶ø²»ÄÜд³É
int data[2][]={1,2,3,4,5,6};
ÒòΪºóÃæÕâÖÖд·¨£¬±àÒëÆ÷¸ù±¾¾Í²»ÖªµÀÓ¦¸ÃÔõÑù¸³Öµ£¡ËäȻָÃ÷ÁËÕâ¸öÊý×éÓÐÁ½ÐУ¬µ«ÊÇÒ»ÐÐÓжàÉÙ¸öÊýÄØ£¿²¢²»ÖªµÀ£¬»òÐíÊÇdata[0][]={1,2,3,4},data[1][]={5,6}»¹ÊÇdata[0][]={1,2,3,4,5,6],data[1][]={}ÄØ£¿ËùÒԾͺܺÃÀí½âÓ¦¸ÃÖ¸¶¨ÁÐÊýÁË¡£
Àý3£º¼òµ¥Ö¸ÕëºÍ¶þά×Ö·û´®
char strings[][10]={"beijing","shanghai","tianjin","chongqi


Ïà¹ØÎĵµ£º

C preprocessor

http://en.wikipedia.org/wiki/C_preprocessor
C preprocessor
from Wikipedia, the free encyclopedia
Jump to:navigation, search
The C preprocessor (cpp) is the preprocessor for the C programming language. In many C implementations, it is a separate program invoked by the compiler as the first part ......

ÈçºÎÓÃC ±àдPHPÀ©Õ¹

PHPÈ¡µÃ³É¹¦µÄÒ»¸öÖ÷ÒªÔ­ÒòÖ®Ò»ÊÇËýÓµÓдóÁ¿µÄ¿ÉÓÃÀ©Õ¹¡£web¿ª·¢ÕßÎÞÂÛÓкÎÖÖÐèÇó£¬ÕâÖÖÐèÇó×îÓпÉÄÜÔÚPHP·¢ÐаüÀïÕÒµ½¡£PHP·¢Ðаü°üÀ¨Ö§³Ö¸÷ÖÖÊý¾Ý¿â£¬Í¼ÐÎÎļþ¸ñʽ£¬Ñ¹Ëõ£¬XML¼¼ÊõÀ©Õ¹ÔÚÄÚµÄÐí¶àÀ©Õ¹¡£
¡¡¡¡À©Õ¹APIµÄÒýÈëʹPHPÈ¡µÃÁ˾޴óµÄ½øÕ¹£¬À©Õ¹API»úÖÆʹPHP¿ª·¢ÉçÇøºÜÈÝÒ׵Ŀª·¢³ö¼¸Ê®ÖÖÀ©Õ¹¡£¡£À©Õ¹Ö÷ÒªµÄ˼ÏëÊÇ ......

C/C++Í·ÎļþÒ»ÀÀ


C/C++
Í·ÎļþÒ»ÀÀ

//////////////////////////////////////////////////////////////////////////
C
Í·Îļþ
(C89,C95)
(C++98,C++03Ò²°üº¬)
include <assert.h>¡¡¡¡¡¡¡¡//Õï¶Ï¿â
include <ctype.h>¡¡¡¡¡¡¡¡ //×Ö·û´¦Àíº¯Êý¿â
include <errno.h>¡¡¡¡¡¡¡¡ //´íÎó¶¨Òå
include <float.h& ......

CÖÐexternÐÞÊηûµÄÓ÷¨

ÔÚCÓïÑÔÖУ¬ÐÞÊηûexternÓÃÔÚ±äÁ¿»òÕߺ¯ÊýµÄÉùÃ÷Ç°£¬ÓÃÀ´ËµÃ÷“´Ë±äÁ¿/º¯ÊýÊÇÔڱ𴦶¨ÒåµÄ£¬ÒªÔÚ´Ë´¦ÒýÓÔ¡£
Ò».externÐÞÊαäÁ¿µÄÉùÃ÷
¾ÙÀýÀ´Ëµ£¬Èç¹ûÎļþa.cÐèÒªÒýÓÃb.cÖбäÁ¿int v£¬¾Í¿ÉÒÔÔÚa.cÖÐÉùÃ÷extern int v£¬È»ºó¾Í¿ÉÒÔÒýÓñäÁ¿v¡£ÕâÀïÐèҪעÒâµÄÊÇ£¬±»ÒýÓõıäÁ¿vµÄÁ´½ÓÊôÐÔ±ØÐëÊÇÍâÁ´½Ó£¨external£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ