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

¡¾ÌâÄ¿4¡¿ÈçºÎ×Ô¼ºÊµÏÖCº¯Êýstrstr()

½âÌâ˼·£º Õâ¸öÍøÂçÉÏÒѾ­Óкܶà´ð°¸£¬ÕâÀï
ÁоÙÒ»¸ö¸´ÔÓ¶ÈΪ0(m*n)µÄÀý×Ó¡£ÊµÏÖµÄÔ­Àí
ºÜ¼òµ¥£¬Ë³Ðò±éÀúÒª²éÕÒµÄ×Ö·û´®£¬Èç¹ûûÓÐÕÒ
µ½£¬×Ö·û´®Ö¸ÕëÍùǰһ룬ÔÙÍùºó±È½ÏÒª²éÕÒµÄ
×Ö·û´®£¨Ä£Ê½´®£©£¬ÈçÏÂͼËùʾ£º
a b c d  d  d a d a c a b d a d d d a d c k
             ->
            d a d a
char* strstr(const char* s1, const char* s2)
{
      if(s1 == NULL || s2 == NULL)
           return NULL;
      while(*s1)
      {  
           while(1)
         {
               int i = 0;
               if(s2[i]  == NULL)
                    return (char*)s1;
               if(s2[i] != s1[i])
                    break;
               i++;
         }
         s1++;
     }
      return NULL;
}


Ïà¹ØÎĵµ£º

c ÓïÑÔº¯Êý´«²ÎµÄÈýÖÖ·½Ê½¼°¶þ¼¶Ö¸ÕëµÄÀí½â

ÆÕͨ±äÁ¿ÊÇÖ±½Ó´«Öµshow(int a,int b)
Ö¸Õë±äÁ¿´«µÝµØÖ·show(int *a,int *b)
ÒýÓñäÁ¿ÊÇÒþʽ´«µØÖ· 1:int x;void show(int &x)£¬Êµ¼Ê´«µÝµÄÊÇxµÄµØÖ·p£¬µ«ÊǺ¯ÊýÄÚ²¿Ê¹ÓÃxʱ»á×Ô¶¯±ä³É*p
                     ......

C²Ù×÷·ûµÄÓÅÏȼ¶ºÍ¹ØÁª¹æÔò

C²Ù×÷·ûµÄÓÅÏȼ¶ºÍ¹ØÁª¹æÔò
²Ù×÷·û
¹ØÁª¹æÔò
¹ØÁª²Ù×÷·û ()  []  ->  .
´Ó×óµ½ÓÒ
Ò»Ôª²Ù×÷·û  !  –  ++  --  +  -  (type)  *  &  sizeof
´ÓÓÒµ½×ó
³Ë·¨ºÍ³ý·¨  *  /  %
´Ó×óµ½ÓÒ
¼Ó·¨ºÍ¼õ·¨  +  -
´Ó× ......

C/C++Ô¤´¦Àí ISO/ANSI C±ê×¼ÒëÎÄÓë×¢½â

<<ISO/ANSI C±ê×¼ÒëÎÄÓë×¢½â C/C++Ô¤´¦Àí²¿·Ö>>
ÄÚÈݼò½é£º±¾ÎĵµÍêÕû·­ÒëÁËC±ê×¼(99°æ)ÖÐÔ¤´¦ÀíºÍÏà¹ØÕ½ڵÄÄÚÈÝ£¬²¢ÔÚÐí¶à±ØÒªÖ®´¦¸½¼ÓÁË×¢½âºÍ³ÌÐòʾÀý£¬ÒÔ°ïÖú¶ÁÕßÀí½â±ê×¼Ô­ÎÄ£¬Í¬Ê±ÖÆ×÷ÁËÏêϸµÄÖÐÓ¢ÎÄË÷Òý±¸²é¡£
ÒëÕߣººúÑå
³ö´¦£ºhttp://blog.csdn.net/huyansoft
Èç¹û×ªÔØ£¬Çë±£ÁôÒëÕߺͳö´¦ÐÅÏ¢£¬Ð ......

C¶àάÊý×é

 Ò»¡¢¶àάÊý×鵨ַµÄ±íʾ·½·¨
¡¡¡¡ÉèÓÐÕûÐͶþάÊý×éa[3][4]ÈçÏ£º
¡¡¡¡0 1 2 3
¡¡¡¡4 5 6 7
¡¡¡¡8 9 10 11
¡¡¡¡ÉèÊý×éaµÄÊ×µØÖ·Îª1000£¬¸÷ϱê±äÁ¿µÄÊ×µØÖ·¼°ÆäÖµÈçͼËùʾ¡£  
ÔÚÇ°ÃæÔø¾­½éÉܹý£¬ CÓïÑÔÔÊÐí°ÑÒ»¸ö¶þάÊý×é·Ö½âΪ¶à¸öһάÊý×éÀ´´¦Àí¡£Òò´ËÊý×éa¿É·Ö½âΪÈý¸öһάÊý×飬¼´a[0]£¬a[1]£¬ ......

CÀàÐÍת»»


Ç¿ÖÆÀàÐÍת»»ÊÇͨ¹ýÀàÐÍת»»ÔËËãÀ´ÊµÏֵġ£ÆäÒ»°ãÐÎʽΪ£º (ÀàÐÍ˵Ã÷·û) (±í´ïʽ) Æä¹¦ÄÜÊǰѱí´ïʽµÄÔËËã½á¹ûÇ¿ÖÆ×ª»»³ÉÀàÐÍ˵Ã÷·ûËù±íʾµÄÀàÐÍ¡£ÀýÈ磺 (float) a °Ñaת»»ÎªÊµÐÍ(int)(x+y) °Ñx+yµÄ½á¹ûת»»ÎªÕûÐÍÔÚʹÓÃÇ¿ÖÆ×ª»»Ê±Ó¦×¢ÒâÒÔÏÂÎÊÌ⣺
1.ÀàÐÍ˵Ã÷·ûºÍ±í´ïʽ¶¼±ØÐë¼ÓÀ¨ºÅ(µ¥¸ö±äÁ¿¿ÉÒÔ²»¼ÓÀ¨ºÅ)£¬Èç°Ñ(int) ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ