Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : c

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[])º¯Êý£¬Ï ......

c ÓïÑÔ»ñȡϵͳʱ¼äºÍÊÀ½ç¸÷ʱÇøʱ¼ä

The meaning of each is:
MemberMeaningRange
tm_sec
seconds after the minute
0-61*
tm_min
minutes after the hour
0-59
tm_hour
hours since midnight
0-23
tm_mday
day of the month
1-31
tm_mon
months since January
0-11
tm_year
years since 1900
tm_wday
days since Sunday
0-6
tm_yday
days since January 1
0-365
tm_isdst
Daylight Saving Time flag
ÏÂÃæ³ÌÐò¼ÆËãÃÀ¹ú·ï»Ë³Ç (-7)£¬Öйú±±¾©(+8)£¬ºÍ±ùµº(0)ʱ¼ä£º
#include <stdio.h>
#include <time.h> 
struct {
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
}tm;
void show(struct tm * timeinfo,int j)
{
 int day,hour;
 if(j>0)
 {
if((j+timeinfo->tm_hour)/24==1)
 day=timeinfo->tm_mday+1;
else
 day=timeinfo->tm_mday;
 hour=(j+timeinfo->tm_hour)%24;
 }
 if(j==0)
 {
 day=timeinfo->tm_mday;
 hour=(j+timeinfo->tm_hour)%24;
 }
 if(j<0)
 {
......

Ò»¸öC³ÌÐòµÄÄÚ´æ²¼¾Ö(memory layout)

Ò»¸öC³ÌÐòµÄÄÚ´æ²¼¾Ö(memory layout)
2009-09-09 15:19
Ò»¸öC³ÌÐòÒ»Ö±ÒÔÀ´¶¼ÊÇÓÉÒÔÏÂ5¸ö¶Î(pieces)×é³É£º
´úÂë¶Î(text segment)£º´æ·ÅCPUÖ´ÐеĻúÆ÷Ö¸Áî(machine instructions)¡£Í¨³£Çé¿öÏ£¬´úÂë¶ÎÊǿɹ²ÏíµÄ£¬Ê¹Æä¿É¹²ÏíµÄÄ¿µÄÊǶÔÓÚƵ·±±»Ö´ÐеijÌÐò£¬Ö»ÐèÒªÔÚÄÚ´æÖÐÓÐÒ»·Ý¿½±´¼´¿É£¬±ÈÈçÎı¾±à¼­Æ÷(text editors)£¬C±àÒëÆ÷£¬shellµÈµÈ¡£ÁíÍ⣬´úÂë¶ÎҲͨ³£ÊÇÖ»¶ÁµÄ£¬Ê¹ÆäÖ»¶ÁµÄÔ­ÒòÊÇ·ÀÖ¹Ò»¸ö³ÌÐòÒâÍâµØÐÞ¸ÄÁËËüµÄÖ¸Áî(prevent a program from accidentally modifying its instructions)¡£
³õʼ»¯Êý¾Ý¶Î/Êý¾Ý¶Î(initialized data segment/data segment):¸Ã¶Î°üº¬ÁËÔÚ³ÌÐòÖÐÃ÷È·±»³õʼ»¯µÄ±äÁ¿¡£ÀýÈ磬һ¸ö²»ÔÚÈκκ¯ÊýÄÚµÄCÉùÃ÷(C declaration)
int   maxcount = 99;
ʹµÃ±äÁ¿maxcount¸ù¾ÝÆä³õʼֵ±»´æ´¢µ½³õʼ»¯Êý¾Ý¶Î¡£
δ³õʼ»¯Êý¾Ý¶Î/bss¶Î(uninitialized data segment/"bss" segment):bssÕâ¸ö½Ð·¨ÊǸù¾ÝÒ»¸öÔçÆڵĻã±àÔËËã·û¶øÀ´£¬Õâ¸ö»ã±àÔËËã·û±êÖ¾×ÅÒ»¸ö¿éµÄ¿ªÊ¼(stood for "block started by symbol")¡£ÔÚ³ÌÐò¿ªÊ¼Ö´ÐÐ֮ǰ£¬bss¶ÎµÄÊý¾Ý±»kernel³õʼ»¯Îª0»òÕß¿ÕÖ¸Õë(null pointers)¡£Ò»¸ö²»ÔÚÈκκ¯ÊýÄÚµÄCÉùÃ÷
long sum[1000];
ʹµÃ±äÁ¿sum± ......

¼ÓÈëcrimson.jar°üºó²»ÄÜʹÓÃC±êÇ©

 CrimsonÀ´×ÔÓÚSun¾èÔù¸øApacheµÄProjectXÏîÄ¿£¬XercesÀ´×ÔIBM¾èÔù¸øApacheµÄXML4JÏîÄ¿£¬½á¹ûXercesʤ³ö£¬³ÉÁËApache XMLС×éÈ«Á¦¿ª·¢µÄXML API£¬¶øCrimonÒѾ­Ôç¾Í²»×öÁË£¬Èç½ñXercesÃûÂúÌìÏ£¬µ½´¦¶¼ÊÇÔÚÓÃXerces DOMºÍSAX½âÎöÆ÷£¬Ö»ÓÐSun²»·þÆø£¬·ÇÒªÔÚJDK1.4ÀïÃæʹÓùýʱµÄCrimson£¬ÈÃÈ˸оõÏñÊÇÔÚ¶ÄÆøÒ»Ñù£¬ÕæÊÇÈÃÈË¿ÉÁ¯ÓÖ¿ÉÆø£¡²»¹ýIBM·¢ÐÐJDKÓõÄXML ½âÎöÆ÷×ÔÈ»ÊÇXerces¡£
ÓÉÓÚJDKµÄClass LoaderµÄÓÅÏȼ¶¹Øϵ£¬µ±Äã²ÉÓÃJAXP±àдXML³ÌÐòµÄʱºò£¬¼´Ê¹°ÑXerces°üÒýÈëCLASSPATH£¬JDK»¹ÊÇ»áÍç¹ÌµÄʹÓÃCrimson£¬ÕâÒ»µãͨ¹ý´ò¿ªJVMµÄverbose²ÎÊý¿ÉÒԹ۲쵽¡£²»¹ýJDKÒ²ÔÊÐíÄã²ÉÓÃÆäËüµÄ½âÎöÆ÷£¬Òò´ËÎÒÃÇ¿ÉÒÔͨ¹ýÔÚJRE\lib\Ŀ¼Ï½¨Ò»¸öjaxp.propertiesµÄÎļþ£¬À´Ìæ»»½âÎöÆ÷£¬jaxp.propertiesÄÚÈÝÈçÏ£º
javax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
javax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl[/color][/indent]
ÕâÑù¾Í¿ÉÒÔʹÓÃXerces£¬µ±È»Äã±ØÐ뻹ÊÇÒª°ÑXerces°ü·Åµ½CLASSPATHÏ¡£ ......

C/C++ ±ÊÊÔ¡¢ÃæÊÔÌâÄ¿´ó»ã×Ü

1.ÇóÏÂÃ溯ÊýµÄ·µ»ØÖµ£¨Î¢Èí£©
int func(x)
{
    int countx = 0;
    while(x)
    {
          countx ++;
          x = x&(x-1);
     }
    return countx;

¼Ù¶¨x = 9999¡£ ´ð°¸£º8
˼·£º½«xת»¯Îª2½øÖÆ£¬¿´º¬ÓеÄ1µÄ¸öÊý¡£
2. ʲôÊÇ“ÒýÓÔ£¿ÉêÃ÷ºÍʹÓÓÒýÓÔҪעÒâÄÄЩÎÊÌ⣿
´ð£ºÒýÓþÍÊÇij¸öÄ¿±ê±äÁ¿µÄ“±ðÃû”(alias)£¬¶ÔÓ¦ÓõIJÙ×÷Óë¶Ô±äÁ¿Ö±½Ó²Ù×÷Ч¹ûÍêÈ«Ïàͬ¡£ÉêÃ÷Ò»¸öÒýÓõÄʱºò£¬ÇмÇÒª¶ÔÆä½øÐгõʼ»¯¡£ÒýÓÃÉùÃ÷Íê±Ïºó£¬Ï൱ÓÚÄ¿±ê±äÁ¿ÃûÓÐÁ½¸öÃû³Æ£¬¼´¸ÃÄ¿±êÔ­Ãû³ÆºÍÒýÓÃÃû£¬²»ÄÜÔٰѸÃÒýÓÃÃû×÷ΪÆäËû±äÁ¿ÃûµÄ±ðÃû¡£ÉùÃ÷Ò»¸öÒýÓ㬲»ÊÇж¨ÒåÁËÒ»¸ö±äÁ¿£¬ËüÖ»±íʾ¸ÃÒýÓÃÃûÊÇÄ¿±ê±äÁ¿ÃûµÄÒ»¸ö±ðÃû£¬Ëü±¾Éí²»ÊÇÒ»ÖÖÊý¾ÝÀàÐÍ£¬Òò´ËÒýÓñ¾Éí²»Õ¼´æ´¢µ¥Ôª£¬ÏµÍ³Ò²²»¸øÒýÓ÷ÖÅä´æ´¢µ¥Ôª¡£²»Äܽ¨Á¢Êý×éµÄÒýÓá£
3. ½«“ÒýÓÔ×÷Ϊº¯Êý²ÎÊýÓÐÄÄЩÌص㣿
£¨1£©´«µÝÒýÓøøº¯ÊýÓë´«µÝÖ¸ÕëµÄЧ¹ûÊÇ ......

C/C++ ±ÊÊÔ¡¢ÃæÊÔÌâÄ¿´ó»ã×Ü

1.ÇóÏÂÃ溯ÊýµÄ·µ»ØÖµ£¨Î¢Èí£©
int func(x)
{
    int countx = 0;
    while(x)
    {
          countx ++;
          x = x&(x-1);
     }
    return countx;

¼Ù¶¨x = 9999¡£ ´ð°¸£º8
˼·£º½«xת»¯Îª2½øÖÆ£¬¿´º¬ÓеÄ1µÄ¸öÊý¡£
2. ʲôÊÇ“ÒýÓÔ£¿ÉêÃ÷ºÍʹÓÓÒýÓÔҪעÒâÄÄЩÎÊÌ⣿
´ð£ºÒýÓþÍÊÇij¸öÄ¿±ê±äÁ¿µÄ“±ðÃû”(alias)£¬¶ÔÓ¦ÓõIJÙ×÷Óë¶Ô±äÁ¿Ö±½Ó²Ù×÷Ч¹ûÍêÈ«Ïàͬ¡£ÉêÃ÷Ò»¸öÒýÓõÄʱºò£¬ÇмÇÒª¶ÔÆä½øÐгõʼ»¯¡£ÒýÓÃÉùÃ÷Íê±Ïºó£¬Ï൱ÓÚÄ¿±ê±äÁ¿ÃûÓÐÁ½¸öÃû³Æ£¬¼´¸ÃÄ¿±êÔ­Ãû³ÆºÍÒýÓÃÃû£¬²»ÄÜÔٰѸÃÒýÓÃÃû×÷ΪÆäËû±äÁ¿ÃûµÄ±ðÃû¡£ÉùÃ÷Ò»¸öÒýÓ㬲»ÊÇж¨ÒåÁËÒ»¸ö±äÁ¿£¬ËüÖ»±íʾ¸ÃÒýÓÃÃûÊÇÄ¿±ê±äÁ¿ÃûµÄÒ»¸ö±ðÃû£¬Ëü±¾Éí²»ÊÇÒ»ÖÖÊý¾ÝÀàÐÍ£¬Òò´ËÒýÓñ¾Éí²»Õ¼´æ´¢µ¥Ôª£¬ÏµÍ³Ò²²»¸øÒýÓ÷ÖÅä´æ´¢µ¥Ôª¡£²»Äܽ¨Á¢Êý×éµÄÒýÓá£
3. ½«“ÒýÓÔ×÷Ϊº¯Êý²ÎÊýÓÐÄÄЩÌص㣿
£¨1£©´«µÝÒýÓøøº¯ÊýÓë´«µÝÖ¸ÕëµÄЧ¹ûÊÇ ......

¼ûÖ¤C²ËÄñµÄ·ÉÏè

  ÏÖÔÚѧ±à³ÌÁË£¬×îÏÈѧµÄÊÇCÓïÑÔ£¬£¬Ï£Íû¾­¹ýŬÁ¦£¬×Ô¼ºÒ²ÄÜÏñÆäËûµÄÈËÒ»Ñù£¬³ÉΪһ¸öÓÅÐãµÄC³ÌÐòÔ±£¬£¬¾ÍÔÚCSDN£¬¼Ç¼ÏÂÎÒµÄC³ÌÐòÔ±³É³¤¹ý³Ì¡£
  Ìý±ðÈË˵£¬Ñ§ÓïÑÔ×îºÃµÄ;¾¶¾ÍÊǶàд´úÂ룬ϣÍûÎÒÔÚÕâÒ»·½ÃæÄÜ×öµÄ±È½ÏºÃ£¬»¹ÓоÍÊÇÅàÑøÁ¼ºÃµÄ±à³Ì·ç¸ñºÍÍŶӾ«Éñ¡£ÔÚCSDN£¬ÓкܶàµÄÁ¼Ê¦ÒæÓÑ£¬ÓÐËûÃÇ£¬ÏàÐÅÎÒÒ»¶¨Äܽø²½µÄ¸ü¿ì£¬³É³¤µÄ¸ü“½¡¿µ”¡£
  4Ä꣬¹»ÁË£¬Ïò¸ß¼¶³ÌÐòÔ±½ø·¢¡£
  ÃÎÏ룬´ÓCSDNÆ𺽠... ... ......
×ܼǼÊý:2015; ×ÜÒ³Êý:336; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [325] [326] [327] [328] 329 [330] [331] [332] [333] [334]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ