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

C ѧϰ±Ê¼Ç£º ÒÆλ²Ù×÷Á·Ï°¡£

#include <stdio.h>
unsigned int reverse_bits(unsigned int value)
{
    unsigned int answer;
    unsigned int i;
    answer = 0;
   
    for(i=1;i!=0;i<<=1){ //´ËÑ­»·¿ÉÒÔºöÂÔ»úÆ÷µÄ²îÒì¡£64λºÍ32λ½Ô¿ÉÓã¬ÔöÇ¿´Ë´úÂëµÄ¿ÉÒÆÖ²ÐÔ
        answer <<=1;
        if(value & 1)
            answer |= 1;
        value >>=1;
    }
    return answer;
}
int main(void)
{
    unsigned int get_answer=reverse_bits(13);
    int i=31;
    char t;
    while(i)
    {
        t ='0'+ ((get_answer >> i) & 1);
        printf("%c",t);
        i--;
    }
}
<<CºÍÖ¸Õë>> µÚ5ÕÂÁ·Ï°Ìâ¡£
Linux 2.6 kernelÖеÄset_bit²Ù×÷£º
ÐèÒª¿¼ÂÇ»úÆ÷ÊÇ32λ»¹ÊÇ64λµÄ¼ÆËã»ú¡£
static inline void set_bit(int nr, volatile unsigned long *addr)
{
    int *a = (int *)addr;
    int mask;
    //unsigned long flags;
    a += nr >> 5; 
    mask = 1 << (nr & 0x1f);
    //local_irq_save_hw(flags);
    *a |= mask;
    //local_irq_restore_hw(flags);
}


Ïà¹ØÎĵµ£º

ת]C,C++¾­µäÎÊÌ⣬¼°ÃæÊÔ±ÊÊÔÌâ


1       ±à³Ì»ù´¡
1.1    »ù±¾¸ÅÄî
1.         µÄÀí½â£ºconst char*, char const*, char*constµÄÇø±ðÎÊÌ⼸ºõÊÇC++ÃæÊÔÖÐÿ´Î    ¶¼»áÓеÄÌâÄ¿¡£ ÊÂʵÉÏÕâ¸ö¸ÅÄîË­¶¼ÓÐÖ»ÊÇÈýÖÖÉùÃ÷·½Ê½·Ç³£ÏàËƺÜÈÝÒ׼ǻ졣 Bja ......

C/C++²»¶¨²ÎÊýµÄÓ÷¨

C++²»¶¨²ÎÊýµÄÓ÷¨ £¨CÀàËÆ£©
2009-11-19 15:41
/*
va_list vl; //¶¨ÒåÒ»¸öÖ¸Ïò²ÎÊýÁбíµÄ±äÁ¿(Ò»¸ö...Ö¸Õë)
va_start(vl,first_param); //°ÑÖ¸Ïò²ÎÊýÁбíµÄ±äÁ¿³õʼ»¯
va_arg(vl,mode); //»ñÈ¡ÏÂÒ»¸ö²ÎÊý,²ÎÊýÀàÐÍÓɵڶþ¸ö²ÎÊýÖ¸¶¨,µÚ¶þ¸ö²ÎÊýÓÃÓÚÔÚva_argÄÚ²¿½øÐгߴç¼ÆËã,ÒÔ±ãÕÒµ½ÏÂÒ»¸ö²ÎÊý
va_end(vl); //½áÊø
......

C# C/S³ÌÐò³ö´í£ºContextSwitchDeadlock is detected

½ñÌìÔÚVS2005µ÷ÊÔÒ»¸öC# C/S³ÌÐò£¬µ±Í¨¹ýRFCÓëSAPÁ¬½Óʱ¼ä¹ý³¤Ê±£¬³öÏÖ´Ë´íÎó£¬ÔÚÍøÉÏÕÒµ½½â¾ö°ì·¨¡£
VS2008ÉϵÄÒ»¸ö³ÌÐò£¬Í¨¹ýOracle.DataAccess.dllÖ´ÐÐdrop user
cascade²Ù×÷£¬ÎÒÔÚsqlplusÖ´Ðд˲Ù×÷´óÔ¼ÐèÒªÒ»·ÖÖÓ×óÓÒʱ¼ä£¬µ±ÎÒÔÚVS2008ÖÐdebugÆô¶¯´Ë³ÌÐòʱ£¬Ò»Ö±½ÓÊÕµ½
“ContextSwitchDeadlock is detected& ......

PCÖ®¸¸C. ThackerÈÙ»ñ2009ÄêͼÁé½±


PCÖ®¸¸C. ThackerÈÙ»ñ2009ÄêͼÁé½±
2010-03-10 01:21 |  3110´ÎÔĶÁ |  ¡¾ÒÑÓÐ16ÌõÆÀÂÛ¡¿·¢±íÆÀÂÛ
¹Ø¼ü´Ê£ºÐÂÎÅ×ÊѶ  | ¸ÐлliujiangCEµÄÌṩ |  ÊÕ²ØÕâƪ×ÊѶ
¸ù¾ÝACM¹Ù·½ÍøÕ¾3ÔÂ9ÈÕ·¢²¼µÄÏûÏ¢£¬2009ÄêͼÁé½±ÊÚÓèÁËÏÖ´úPCÖ®¸¸Charles Thacker£¬ÒÔ±íÕÃËû¶ÔµÚһ̨ÏÖ´ú¸öÈ˼ÆËã»úXerox PARC Altoµ ......

³ÌÐòÔ±µÄ×ÔÎÒÐÞÑø: ³ÌÐòÔËÐеĻùʯ C/C++ÔËÐпâ

Ò»¸öCÓïÑÔÔËÐпâ´óÖ°üº¬ÁËÈçϹ¦ÄÜ:
1. Æô¶¯ÓëÍ˳ö: °üÀ¨Èë¿Úº¯Êý¼°Èë¿Úº¯ÊýËùÒÀÀµµÄÆäËüº¯ÊýµÈ
2. ±ê×¼º¯Êý: ÓÉCÓïÑÔ±ê×¼¹æ¶¨µÄCÓïÑÔ±ê×¼¿âËùÓµÓеĺ¯ÊýʵÏÖ.
3. I/O: IO¹¦Äܵķâ×°ºÍʵÏÖ
4. ¶Ñ:¶ÑµÄ·â×°ºÍʵÏÖ
5. ÓïÑÔʵÏÖ: ÓïÑÔÖÐһЩÌØÊ⹦ÄܵÄʵÏÖ.
6. µ÷ÊÔ: ʵÏÖµ÷ÊÔ¹¦ÄܵĴúÂë.
ÔÚÕâЩÔËÐпâµÄ×é³É³É·ÖÖÐ, C ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ