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

CÓïÑÔλÔËËã

Ç°Ãæ½éÉܵĸ÷ÖÖÔËË㶼ÊÇÒÔ×Ö½Ú×÷Ϊ×î»ù±¾Î»½øÐеġ£ µ«Ôںܶàϵͳ³ÌÐòÖг£ÒªÇóÔÚλ(bit)Ò»¼¶½øÐÐÔËËã»ò´¦Àí¡££ÃÓïÑÔÌṩÁËλÔËËãµÄ¹¦ÄÜ£¬ÕâʹµÃ£ÃÓïÑÔÒ²ÄÜÏñ»ã±àÓïÑÔÒ»ÑùÓÃÀ´±àдϵͳ³ÌÐò¡£
12.1 λÔËËã·û£ÃÓïÑÔÌṩÁËÁùÖÖλÔËËã·û£º
    &          °´Î»Óë
    |          °´Î»»ò
    ^          °´Î»Òì»ò
    ~          È¡·´
    <<         ×óÒÆ
    >>         ÓÒÒÆ
12.1.1 °´Î»ÓëÔËËã
    °´Î»ÓëÔËËã·û"&"ÊÇË«Ä¿ÔËËã·û¡£Æ书ÄÜÊDzÎÓëÔËËãµÄÁ½Êý¸÷¶ÔÓ¦µÄ¶þ½øλÏàÓë¡£Ö»ÓжÔÓ¦µÄÁ½¸ö¶þ½øλ¾ùΪ1ʱ£¬½á¹ûλ²ÅΪ1£¬·ñÔòΪ0¡£²ÎÓëÔËËãµÄÊýÒÔ²¹Â뷽ʽ³öÏÖ¡£
ÀýÈ磺9&5¿ÉдËãʽÈçÏ£º
      00001001        (9µÄ¶þ½øÖƲ¹Âë)
     &00000101        (5µÄ¶þ½øÖƲ¹Âë)
      00000001        (1µÄ¶þ½øÖƲ¹Âë)
¿É¼û9&5=1¡£
°´Î»ÓëÔËËãͨ³£ÓÃÀ´¶ÔijЩλÇå0»ò±£ÁôijЩλ¡£ÀýÈç°Ña µÄ¸ß°ËλÇå 0 £¬±£ÁôµÍ°Ë룬¿É×÷a&255ÔËËã( 255 µÄ¶þ½øÖÆÊýΪ0000000011111111)¡£
¡¾Àý12.1¡¿
main(){
    int a=9,b=5,c;
    c=a&b;
    printf("a=%d\nb=%d\nc=%d\n",a,b,c);
}
12.1.2 °´Î»»òÔËËã
°´Î»»òÔËËã·û“|”ÊÇË«Ä¿ÔËËã·û¡£Æ书ÄÜÊDzÎÓëÔËËãµÄÁ½Êý¸÷¶ÔÓ¦µÄ¶þ½øλÏà»ò¡£Ö»Òª¶ÔÓ¦µÄ¶þ¸ö¶þ½øλÓÐÒ»¸öΪ1ʱ£¬½á¹ûλ¾ÍΪ1¡£²ÎÓëÔËËãµÄÁ½¸öÊý¾ùÒÔ²¹Âë³öÏÖ¡£
ÀýÈ磺9|5¿ÉдËãʽÈçÏ£º
    00001001
   |00000101
    00001101        (Ê®½øÖÆΪ13)¿É¼û9|5=13
¡¾Àý12.2¡¿
main(){
    int a=9,b=5,c;
    c=a|b;
    printf("a=%


Ïà¹ØÎĵµ£º

C++ÖÐextern ¡°C¡±º¬ÒåÉî²ã̽Ë÷

1.ÒýÑÔ
¡¡¡¡C++ÓïÑԵĴ´½¨³õÖÔÊÇ“a better C”£¬µ«ÊÇÕâ²¢²»Òâζ×ÅC++ÖÐÀàËÆCÓïÑÔµÄÈ«¾Ö±äÁ¿ºÍº¯ÊýËù²ÉÓõıàÒëºÍÁ¬½Ó·½Ê½ÓëCÓïÑÔÍêÈ«Ïàͬ¡£×÷ΪһÖÖÓûÓëC¼æÈݵÄÓïÑÔ£¬C++±£ÁôÁËÒ»²¿·Ö¹ý³ÌʽÓïÑÔµÄÌص㣨±»ÊÀÈ˳ÆΪ“²»³¹µ×µØÃæÏò¶ÔÏ󔣩£¬Òò¶øËü¿ÉÒÔ¶¨Òå²»ÊôÓÚÈκÎÀàµÄÈ«¾Ö±äÁ¿ºÍº¯Êý¡£µ«ÊÇ£¬C++±Ï¾ ......

¹ØÓÚ Ö¸Õë CµÄ¾«Ëè

ÒªÁ˽âÖ¸Õë,¶à¶àÉÙÉÙ»á³öÏÖһЩ±È½Ï¸´ÔÓµÄÀàÐÍ,ËùÒÔÎÒÏȽéÉÜ
Ò»ÏÂÈçºÎÍêÈ«Àí½âÒ»¸ö¸´ÔÓÀàÐÍ,ÒªÀí½â¸´ÔÓÀàÐÍÆäʵºÜ¼òµ¥,Ò»
¸öÀàÐÍÀï»á³öÏֺܶàÔËËã·û,ËûÃÇÒ²ÏñÆÕͨµÄ±í´ïʽһÑù,ÓÐÓÅÏÈ
¼¶,ÆäÓÅÏȼ¶ºÍÔËËãÓÅÏȼ¶Ò»Ñù,ËùÒÔÎÒ×ܽáÁËÒ»ÏÂÆäÔ­Ôò:
´Ó±äÁ¿Ãû´¦Æð,¸ù¾ÝÔËËã·ûÓÅÏȼ¶½áºÏ,Ò»²½Ò»²½·ÖÎö.
ÏÂÃæÈÃÎÒÃÇÏÈ´Ó¼òµ¥µÄÀàÐ ......

c/c++±ÊÊÔ


1£®½ø³ÌºÍÏ̵߳IJî±ð¡£
Ïß³ÌÊÇÖ¸½ø³ÌÄÚµÄÒ»¸öÖ´Ðе¥Ôª,Ò²Êǽø³ÌÄڵĿɵ÷¶ÈʵÌå.
Óë½ø³ÌµÄÇø±ð:
(1)µ÷¶È£ºÏß³Ì×÷Ϊµ÷¶ÈºÍ·ÖÅäµÄ»ù±¾µ¥Î»£¬½ø³Ì×÷ΪӵÓÐ×ÊÔ´µÄ»ù±¾µ¥Î»
(2)²¢·¢ÐÔ£º²»½ö½ø³ÌÖ®¼ä¿ÉÒÔ²¢·¢Ö´ÐУ¬Í¬Ò»¸ö½ø³ÌµÄ¶à¸öÏß³ÌÖ®¼äÒ²¿É²¢·¢Ö´ÐÐ
(3)ÓµÓÐ×ÊÔ´£º½ø³ÌÊÇÓµÓÐ×ÊÔ´µÄ¶ÀÁ¢µ¥Î»£¬Ï̲߳»ÓµÓÐϵͳ×ÊÔ´£¬µ«¿ÉÒ ......

CÓïÑÔº¯Êý£¨Ò»£©


ÔÚÇ°ÃæÒѾ­½éÉܹý£¬£ÃÔ´³ÌÐòÊÇÓɺ¯Êý×é³ÉµÄ¡£ËäÈ»ÔÚÇ°Ãæ¸÷ÕµijÌÐòÖдó¶¼Ö»ÓÐÒ»¸öÖ÷º¯Êýmain()£¬µ«ÊµÓóÌÐòÍùÍùÓɶà¸öº¯Êý×é³É¡£º¯ÊýÊÇ£ÃÔ´³ÌÐòµÄ»ù±¾Ä£¿é£¬Í¨¹ý¶Ôº¯ÊýÄ£¿éµÄµ÷ÓÃʵÏÖÌض¨µÄ¹¦ÄÜ¡££ÃÓïÑÔÖеĺ¯ÊýÏ൱ÓÚÆäËü¸ß¼¶ÓïÑÔµÄ×Ó³ÌÐò¡££ÃÓïÑÔ²»½öÌṩÁ˼«Îª·á¸»µÄ¿âº¯Êý(ÈçTurbo C£¬MS C¶¼ÌṩÁËÈý°Ù¶à¸ö¿âº¯Êý)£¬» ......

CÓïÑÔº¯Êý£¨¶þ£©

¡¾Àý8.6¡¿HanoiËþÎÊÌâ
    Ò»¿é°åÉÏÓÐÈý¸ùÕ룬A£¬B£¬C¡£AÕëÉÏÌ×ÓÐ64¸ö´óС²»µÈµÄÔ²ÅÌ£¬´óµÄÔÚÏ£¬Ð¡µÄÔÚÉÏ¡£Èçͼ5.4Ëùʾ¡£Òª°ÑÕâ64¸öÔ²ÅÌ´ÓAÕëÒƶ¯CÕëÉÏ£¬Ã¿´ÎÖ»ÄÜÒƶ¯Ò»¸öÔ²ÅÌ£¬Òƶ¯¿ÉÒÔ½èÖúBÕë½øÐС£µ«ÔÚÈκÎʱºò£¬ÈκÎÕëÉϵÄÔ²Å̶¼±ØÐë±£³Ö´óÅÌÔÚÏ£¬Ð¡ÅÌÔÚÉÏ¡£ÇóÒƶ¯µÄ²½Öè¡£
±¾ÌâËã·¨·ÖÎöÈçÏ£¬ÉèAÉÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ