CÖ¸Õ루2£©
CÓïÑÔ±ØÖª±Ø»á£¨2£©
4.º¯ÊýºÍÖ¸Õë
4.1. Ö¸Ïòº¯ÊýµÄÖ¸Õë
Ö¸Ïòº¯ÊýµÄÖ¸Õ뼴ͨ³£ËµµÄº¯ÊýÖ¸Õ룬ÕýÊÇÓÉÓÚÕâЩ¼ò³Æ£¬ËùÒÔËüºÍ·µ»ØÖ¸ÕëµÄº¯Êý£¨Ö¸Õ뺯Êý£©ÈÝÒ×»ìÏý£¬¶øÇÒÒ²ÓÉÓÚд·¨ÉϱȽÏÏà½ü£¬¾ÍÏñÊý×éÖ¸Õë(int (*p)[4])ºÍÖ¸ÕëÊý×é(int *p[4])Ò»Ñù£¬Ç°Õß±íʾָÕë±äÁ¿pÖ¸ÏòÒ»¸öһάÊý×飬Õâ¸öÊý×麬ÓÐ4¸öintÐͱäÁ¿£¬ËùÒÔp++ºó£¬P¾ÍÖ¸ÏòÏÂÒ»¸öһάÊý×飻¶øºóÕß±íʾpÊÇÒ»¸öÊý×飬º¬ÓÐ4¸öÖ¸ÏòintÐÍÊýµÄÖ¸Õë·Ö±ðΪp[0],p[1],p[2],p[3]¡£
int max(int x,int y){
}
int (*ps)()=swap; //¶¨ÒåÁËÒ»¸öº¯ÊýÖ¸ÕëÖ¸Ïòswapº¯Êý
int (*ps)(int x,int y); //Ò²¶¨ÒåÁËÒ»¸öº¯ÊýÖ¸Õë¡£
µ÷ÓÃʱ£ºmax=max(a,b);»òmax=(*ps)(a,b);
4.2. ·µ»ØÖ¸ÕëµÄº¯Êý
char *getString(char strings[][10],int n){
return strings[i] //¼ÙÉè·µ»Ø××Ö·û´®
}
µ÷ÓÃʱ£ºchar *p=getString(strings,4);
printf("%s\n",p);
4.3. mainº¯Êý
mainº¯ÊýÊÇCÓïÑÔÖÐ×îÖØÒªµÄÒ»¸öº¯Êý£¬µ«ÊÇͨ³£ÔÚ±àд³ÌÐòµÄʱºòºÜÉÙÓõ½Ê¹ÓòÎÊýµÄmain(int argc,char *args[])º¯Êý£¬ÏÂÃæÊÇÒ»¸öÀý×Ó
int main(int argc,char *args[]){
//char *args[]ÐβÎÊÇÒ»¸öÖ¸ÕëÊý×飬ÿ¸öÔªËض¼ÊÇÒ»¸öcharÐÍÖ¸Õ룬ËùÒÔ¿ÉÒÔÖ¸ÏòÒ»¸öÊý×é
while(argc-->1){
printf("%s\n",*(++args));
}
}
5.½á¹¹Ìå
¼òµ¥µÄ½á¹¹ÌåºÜ¼òµ¥£¬Òª×¢ÒâÇø·ÖµÄÊÇÖ¸Ïò½á¹¹ÌåµÄÖ¸Õ룬Èçstruct PEOPLE *p=people1;ÕâÀï¼ÙÉèPEOPLEÊǶ¨ÒåµÄÒ»¸ö½á¹¹ÌåÀàÐÍ£¬people1ÊÇPEOPLEÀàÐ͵ĽṹÌå±äÁ¿¡£
ʹÓÃÖ¸Õëµ÷ÓýṹʱÓÐÁ½ÖÖ·½·¨£º1)(*p).name»ò2)p->name¡£
ʹÓýṹÌåÀ´±àдÃæÏò¶ÔÏóµÄ´úÂë¡£
Àý×Ó£º
#include<stdio.h>
#include<stdlib.h>
typedef struct node{
int x;
int y;
void (*print)();
}NODE;
void print();
NODE *initNODE(){
NODE *node=(NODE*)malloc(sizeof(NODE));
node->print=print;
return node;
}
NODE *node=NULL;
int main(){
node=initNODE(
Ïà¹ØÎĵµ£º
×Ô¼ºÊ¹ÓÃvim±à¼´úÂëÒ²ÊÇÓÐÒ»¶Îʱ¼äÀ´£¬Ä¿Ç°ÔĶÁ¡¢Ð޸ġ¢Ð´´úÂë»ù±¾¶¼Àë²»¿ªËûÁË¡£±¾ÈËʹÓùýµÄ±à¼Æ÷ºÜÉÙ£¬ÒÔÇ°Ò»°ã¶¼ÊÇʹÓóÌÐò¿ª·¢IDE×Ô´øµÄ±à¼Æ÷Щ´úÂ룬û¾õµÃʲô·½±ã¡£¿ªÊ¼Ê¹ÓÃvimµÄ¸Õ¸Õ½Ó´¥linux³ÌÐò¿ª·¢µÄʱºò£¬ÄÇʱ¿´µ½ÆäËûÈËÒ»°ã¶¼ÊÇÔÚwindowsÏÂʹÓÃSource Insight ±à¼´úÂ룬ȻºóÔÚÐéÄâ»úlinuxÏÂmake¡£ÎұȽ ......
Èç¹ûÓû§ÊìϤLinuxϵÄsed¡¢awk¡¢grep»òvi£¬ÄÇô¶ÔÕýÔò±í´ïʽÕâÒ»¸ÅÄî¿Ï¶¨²»»áÄ°Éú¡£ÓÉÓÚËü¿ÉÒÔ¼«´óµØ¼ò»¯´¦Àí×Ö·û´®Ê±µÄ¸´ÔӶȣ¬Òò´ËÏÖÔÚÒѾÔÚÐí¶àLinuxʵÓù¤¾ßÖеõ½ÁËÓ¦Óá£Ç§Íò²»ÒªÒÔΪÕýÔò±í´ïʽֻÊÇPerl¡¢Python¡¢BashµÈ½Å±¾ÓïÑÔµÄרÀû£¬×÷ΪCÓïÑÔ³ÌÐòÔ±£¬Óû§Í¬Ñù¿ÉÒÔÔÚ×Ô¼ºµÄ³ÌÐòÖÐÔËÓÃÕýÔò±í´ïʽ¡£
±ê×¼µÄCºÍC ......
½üÀ´ÓÖÓÐÈËÔÚȺÀïÎÊÈçºÎÓÃcÓïÑÔ±àÖÆdllÎļþ£¨¶¯Ì¬Á´½Ó¿â£©¡£
ÔÀ´Ã»ÓжÔÕâ¸öÎÊÌâÌ«ÔÚÒâ¹ý£¬Ò²Ã»Óг¢ÊÔ¹ýÈκνâ¾ö·½°¸£¬±Ï¾¹ÔÀ´ÎÒÊÇÓÃvbµÄ£¨ÏÖÔÚÓÃ.net£©£¬×ö¸ödllÖ»²»¹ýÊǵãѡһϽ¨Á¢activeX dll¹¤³ÌµÄͼ±ê¶øÒÑ¡£½ñÌìÔÚÍøÉÏÓëÅóÓÑÁÄÌ죬¿´ÁËËûÖ¸¸øÎҵļ¸¸ö¼¸¸öÎļþ£¬ÓÃMingW½«C³ÌÐò±àÒë³ÉdllÎļþµÄÀý×Ó£¬ÎÒ»ÐÈ»´óÎò£¬ÔÀ ......
#(¶Á×ö "C sharp")ÊÇ΢Èí¹«Ë¾ÔÚÈ¥ÄêÁùÔ·¢²¼µÄÒ»ÖÖеıà³ÌÓïÑÔ,²¢¶¨ÓÚÔÚ΢ÈíÖ°Òµ¿ª·¢ÕßÂÛ̳(PDC)ÉϵÇ̨ÁÁÏà.C#ÊÇ΢Èí¹«Ë¾Ñо¿Ô±Anders HejlsbergµÄ×îгɹû.C#¿´ÆðÀ´ÓëJavaÓÐמªÈ˵ÄÏàËÆ;Ëü°üÀ¨ÁËÖîÈçµ¥Ò»¼Ì³Ð,½çÃæ,ÓëJava¼¸ºõͬÑùµÄÓï·¨,ºÍ±àÒë³ÉÖмä´úÂëÔÙÔËÐеĹý³Ì.µ«ÊÇC#ÓëJavaÓÐ×ÅÃ÷ÏԵIJ»Í¬,Ëü½è¼øÁËDelphiµÄÒ»¸ ......
»ñÈ¡IPµÄC ´úÂë #include<stdio.h> #include<winsock2.h> #pragma comment(lib,"ws2_32.lib") void CheckIP(void) //¶¨ÒåCheckIP£¨£©º¯Êý£¬ÓÃÓÚ»ñÈ¡±¾»úIPµØÖ· { WSADATA wsaData; char name[255]; //¶¨ÒåÓà ...
»ñÈ¡IPµÄC ´úÂë
#include<stdio.h>
#include<winsock2.h>
#pragma comment(li ......